diff --git a/docs/docs/04-standard-library/ui/api-reference.md b/docs/docs/04-standard-library/ui/api-reference.md index f0b180a91d4..1c7bbec1440 100644 --- a/docs/docs/04-standard-library/ui/api-reference.md +++ b/docs/docs/04-standard-library/ui/api-reference.md @@ -231,6 +231,133 @@ The tree node. --- +### FileBrowser + +A file browser can be used to browse files. + +#### Initializers + +```wing +bring ui; + +new ui.FileBrowser(label: str, putHandler: IFileBrowserPutHandler, deleteHandler: IFileBrowserDeleteHandler, getHandler: IFileBrowserGetHandler, listHandler: IFileBrowserListHandler); +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| label | str | *No description.* | +| putHandler | IFileBrowserPutHandler | *No description.* | +| deleteHandler | IFileBrowserDeleteHandler | *No description.* | +| getHandler | IFileBrowserGetHandler | *No description.* | +| listHandler | IFileBrowserListHandler | *No description.* | + +--- + +##### `label`Required + +- *Type:* str + +--- + +##### `putHandler`Required + +- *Type:* IFileBrowserPutHandler + +--- + +##### `deleteHandler`Required + +- *Type:* IFileBrowserDeleteHandler + +--- + +##### `getHandler`Required + +- *Type:* IFileBrowserGetHandler + +--- + +##### `listHandler`Required + +- *Type:* IFileBrowserListHandler + +--- + + +#### Static Functions + +| **Name** | **Description** | +| --- | --- | +| onLiftType | A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. | +| isVisualComponent | Returns whether the given construct is a visual component. | + +--- + +##### `onLiftType` + +```wing +bring ui; + +ui.FileBrowser.onLiftType(host: IInflightHost, ops: MutArray); +``` + +A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. + +The list of requested inflight methods +needed by the inflight host are given by `ops`. + +This method is commonly used for adding permissions, environment variables, or +other capabilities to the inflight host. + +###### `host`Required + +- *Type:* IInflightHost + +--- + +###### `ops`Required + +- *Type:* MutArray<str> + +--- + +##### `isVisualComponent` + +```wing +bring ui; + +ui.FileBrowser.isVisualComponent(c: IConstruct); +``` + +Returns whether the given construct is a visual component. + +###### `c`Required + +- *Type:* constructs.IConstruct + +--- + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| node | constructs.Node | The tree node. | + +--- + +##### `node`Required + +```wing +node: Node; +``` + +- *Type:* constructs.Node + +The tree node. + +--- + + ### HttpClient An HttpClient can be used to make HTTP requests. @@ -768,6 +895,164 @@ inflight handle(): str Function that returns a string to display. +### IFileBrowserDeleteHandler + +- *Extends:* IInflight + +- *Implemented By:* IFileBrowserDeleteHandler + +**Inflight client:** [@winglang/sdk.ui.IFileBrowserDeleteHandlerClient](#@winglang/sdk.ui.IFileBrowserDeleteHandlerClient) + +A resource with an inflight "handle" method that can be passed to `IFileBrowser`. + + + +### IFileBrowserDeleteHandlerClient + +- *Implemented By:* IFileBrowserDeleteHandlerClient + +Inflight client for `IFileBrowserDeleteHandler`. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| handle | Function that performs an action. | + +--- + +##### `handle` + +```wing +inflight handle(payload: str): void +``` + +Function that performs an action. + +###### `payload`Required + +- *Type:* str + +--- + + +### IFileBrowserGetHandler + +- *Extends:* IInflight + +- *Implemented By:* IFileBrowserGetHandler + +**Inflight client:** [@winglang/sdk.ui.IFileBrowserGetHandlerClient](#@winglang/sdk.ui.IFileBrowserGetHandlerClient) + +A resource with an inflight "handle" method that can be passed to `IFileBrowser`. + + + +### IFileBrowserGetHandlerClient + +- *Implemented By:* IFileBrowserGetHandlerClient + +Inflight client for `IFileBrowserGetHandler`. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| handle | Function that performs an action. | + +--- + +##### `handle` + +```wing +inflight handle(payload: str): str +``` + +Function that performs an action. + +###### `payload`Required + +- *Type:* str + +--- + + +### IFileBrowserListHandler + +- *Extends:* IInflight + +- *Implemented By:* IFileBrowserListHandler + +**Inflight client:** [@winglang/sdk.ui.IFileBrowserListHandlerClient](#@winglang/sdk.ui.IFileBrowserListHandlerClient) + +A resource with an inflight "handle" method that can be passed to `IFileBrowser`. + + + +### IFileBrowserListHandlerClient + +- *Implemented By:* IFileBrowserListHandlerClient + +Inflight client for `IFileBrowserListHandler`. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| handle | Function that performs an action. | + +--- + +##### `handle` + +```wing +inflight handle(): MutArray +``` + +Function that performs an action. + + +### IFileBrowserPutHandler + +- *Extends:* IInflight + +- *Implemented By:* IFileBrowserPutHandler + +**Inflight client:** [@winglang/sdk.ui.IFileBrowserPutHandlerClient](#@winglang/sdk.ui.IFileBrowserPutHandlerClient) + +A resource with an inflight "handle" method that can be passed to `IFileBrowser`. + + + +### IFileBrowserPutHandlerClient + +- *Implemented By:* IFileBrowserPutHandlerClient + +Inflight client for `IFileBrowserVoidHandler`. + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| handle | Function that performs an action. | + +--- + +##### `handle` + +```wing +inflight handle(payload: str): void +``` + +Function that performs an action. + +###### `payload`Required + +- *Type:* str + +--- + + ### IHttpClientGetApiSpecHandler - *Extends:* IInflight