Interface: AnyDropFileContext
Defined in: ui/src/types.ts:129
Context of a file row.
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
active | boolean | The keyboard-active row. | - | ui/src/types.ts:153 |
can | object | Whether each built-in action applies now. | - | ui/src/types.ts:159 |
can.cancel | boolean | - | - | ui/src/types.ts:159 |
can.pause | boolean | - | - | ui/src/types.ts:159 |
can.remove | boolean | - | - | ui/src/types.ts:159 |
can.resume | boolean | - | - | ui/src/types.ts:159 |
can.retry | boolean | - | - | ui/src/types.ts:159 |
depth | number | Tree level, 0 at the root. | - | ui/src/types.ts:151 |
error | ErrorEntry | null | The error-list entry of the file. | - | ui/src/types.ts:145 |
errorMessage | string | The text data-ad-errormessage shows (error or canceled), else an empty string. | - | ui/src/types.ts:147 |
file | | AnyDropFile | MockFile | - | - | ui/src/types.ts:131 |
instance | AnyDrop | The instance. | AnyDropRenderContext.instance | ui/src/types.ts:117 |
kind | "file" | - | - | ui/src/types.ts:130 |
label | string | The shown name: file.name, or the relative path in the flat view. | - | ui/src/types.ts:133 |
layout | string & object | AnyDropLayout | The current layout. | AnyDropRenderContext.layout | ui/src/types.ts:119 |
parts | object | The default parts, already painted. | - | ui/src/types.ts:157 |
parts.actions | HTMLElement | - | - | ui/src/types.ts:157 |
parts.badge | HTMLElement | - | - | ui/src/types.ts:157 |
parts.preview | HTMLElement | - | - | ui/src/types.ts:157 |
progress | number | 0 to 100 (100 when success). | - | ui/src/types.ts:143 |
row | HTMLElement | The library-owned .ad-row. | - | ui/src/types.ts:155 |
sizeText | string | Formatted size, plain text. | - | ui/src/types.ts:135 |
status | FileStatus | added, queued, uploading, paused, success, error or canceled. | - | ui/src/types.ts:137 |
statusText | string | The status badge text. | - | ui/src/types.ts:139 |
thumbnail | string | null | The thumbnail data URL once made. | - | ui/src/types.ts:149 |
waiting | boolean | Paused only by the system (offline or unreachable). | - | ui/src/types.ts:141 |
Methods
cancel()
ts
cancel(): void;Defined in: ui/src/types.ts:164
Returns
void
html()
ts
html(strings, ...values): HTMLElement;Defined in: ui/src/types.ts:123
Builds DOM from markup; every ${value} is HTML-escaped.
Parameters
| Parameter | Type |
|---|---|
strings | TemplateStringsArray |
...values | unknown[] |
Returns
HTMLElement
Inherited from
icon()
ts
icon(name): HTMLElement;Defined in: ui/src/types.ts:125
<span class="ad-icon" aria-hidden="true"> holding the configured icon.
Parameters
| Parameter | Type |
|---|---|
name | | string & object | AnyDropIconName |
Returns
HTMLElement
Inherited from
pause()
ts
pause(): void;Defined in: ui/src/types.ts:161
Runs the built-in action (a no-op when it does not apply; never goes through an override).
Returns
void
remove()
ts
remove(): void;Defined in: ui/src/types.ts:165
Returns
void
resume()
ts
resume(): void;Defined in: ui/src/types.ts:162
Returns
void
retry()
ts
retry(): void;Defined in: ui/src/types.ts:163
Returns
void
t()
ts
t(key, vars?): string;Defined in: ui/src/types.ts:121
The current text of a dict* option, with placeholders replaced. Unknown keys return the key.
Parameters
| Parameter | Type |
|---|---|
key | | "dictFileTooBig" | "dictInvalidFileType" | "dictResponseError" | "dictUploadCanceled" | "dictMaxFilesExceeded" | "dictFileUnreadable" | "dictInvalidPath" | "dictFileSizeUnits" | keyof AnyDropDict |
vars? | Record<string, string | number> |
Returns
string