metawrite
Version:
Appwrite SDK with ready to go components for Svelte / SvelteKit
123 lines (122 loc) • 3.68 kB
TypeScript
import { SvelteComponentTyped } from "svelte";
declare const __propDef: {
props: {
/**
* @name Collection ID
* @type {string}
*/ collectionId: string;
/**
* @name Queries
* @type {string[]}
* Array of query strings.
*/ queries?: string[];
/**
* @name Limit
* @type {number}
* Maximum number of documents to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
*/ limit?: number;
/**
* @name offset
* @type {number}
* Default: 0
*/ offset?: number;
/**
* @name Cursor
* @type {string}
* ID of the document used as the starting point for the query, excluding the document itself.
*/ cursor?: string;
/**
* @name cursorDirection
* @type {string}
*/ cursorDirection?: string;
/**
* @name orderAttributes
* @type {string[]}
* Array of attributes used to sort results.
*/ orderAttributes?: string[];
/**
* @name orderTypes
* @type {string[]}
* ASC or DESC
* Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order.
*/ orderTypes?: string[];
/**
* @description Enables document caching. Call `actions.reload()` to get fresh document(s)
*/ cache?: boolean;
};
events: {
[evt: string]: CustomEvent<any>;
};
slots: {
loading: {};
default: {
documents: any[];
actions: {
reload: () => void;
create: (documentId?: string, data?: {}, read?: string[], write?: string[]) => Promise<import("appwrite").Models.Document>;
};
};
error: {
error: any;
};
};
};
export declare type CollectionProps = typeof __propDef.props;
export declare type CollectionEvents = typeof __propDef.events;
export declare type CollectionSlots = typeof __propDef.slots;
/**
* ### `<Collection />`
*
* #### Arguments
*
* - collectionId - *required* `@type - {string}`
*
* - cache - *optional*, by default set to false `@type - {boolean}`
*
* **query: `@type - {object}`**
*
* - queries - *optional* `@type - {string[]}`
*
* - limit - *optional* `@type - {number}`
*
* - offset - *optional* `@type - {number}`
*
* - cursor - *optional* `@type - {string}`
*
* - cursorDirection - *optional* `@type - {string}`
*
* - orderAttributes - *optional* `@type - {string[]}`
*
* - orderTypes - *optional* `@type - {string[]}`
*
* #### Slots
*
* - **loading**
* - **error**
*
* #### Directives
*
* **let:actions**
* | Name | Description |
* | --- | --- |
* | `reload()` | Reload. |
* | `create(documentId, data, read, write)` | Creates a Document. `data` - `@type - {string}`.<br /> `read`/`write` is optional `@type - {string[]}`.<br />`documentId` is optional, by default generates unique `@type - {string}`. |
*
* - **let:documents**
* - **let:error**
*
* #### Example
*
* ```svelte
* <script>
* import { Collection } from "metawrite";
* </script>
*
* <Collection collectionId="5f56a3035a01f" let:documents>
* You have {documents.length} documents.
* </Collection>
* ```
*/
export default class Collection extends SvelteComponentTyped<CollectionProps, CollectionEvents, CollectionSlots> {
}
export {};