| 63 | * managing media. |
| 64 | */ |
| 65 | export interface MediaStore { |
| 66 | /** |
| 67 | * The [input accept string](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) |
| 68 | * that describes what kind of files the Media Store will accept. |
| 69 | */ |
| 70 | accept: string; |
| 71 | |
| 72 | /** |
| 73 | * The maximum size of a file that can be uploaded. |
| 74 | */ |
| 75 | maxSize?: number; |
| 76 | |
| 77 | /** |
| 78 | * Uploads a set of files to the Media Store and |
| 79 | * returns a Promise containing the Media objects |
| 80 | * for those files. |
| 81 | */ |
| 82 | persist(files: MediaUploadOptions[]): Promise<Media[]>; |
| 83 | |
| 84 | /** |
| 85 | * Delete a media object from the store. |
| 86 | */ |
| 87 | delete(media: Media): Promise<void>; |
| 88 | |
| 89 | /** |
| 90 | * Lists all media in a specific directory. |
| 91 | */ |
| 92 | list(options?: MediaListOptions): Promise<MediaList>; |
| 93 | |
| 94 | /** |
| 95 | * Reserved hook for renaming a media object in the store. |
| 96 | * |
| 97 | * Not yet implemented in `TinaMediaStore` or surfaced in `MediaManager` — |
| 98 | * declared here as an extension point so stores can begin to opt in once |
| 99 | * the corresponding assets-api endpoint is built. |
| 100 | */ |
| 101 | rename?(from: string, to: string): Promise<Media>; |
| 102 | |
| 103 | /** |
| 104 | * Indicates that uploads and deletions are not supported |
| 105 | * |
| 106 | * @default false |
| 107 | */ |
| 108 | isStatic?: boolean; |
| 109 | |
| 110 | /** |
| 111 | * Converts a Media object to the value stored in a form field. |
| 112 | * |
| 113 | * Typically returns `media.src`. If not implemented, the image field |
| 114 | * plugin falls back to `media.src`. |
| 115 | */ |
| 116 | parse?(media: Media): string; |
| 117 | } |
| 118 | |
| 119 | export declare type MediaListOffset = string | number; |
| 120 | /** |
no outgoing calls
no test coverage detected