MCPcopy
hub / github.com/tinacms/tinacms / MediaStore

Interface MediaStore

packages/tinacms/src/toolkit/core/media.ts:65–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 * managing media.
64 */
65export 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
119export declare type MediaListOffset = string | number;
120/**

Callers 22

MediaPickerFunction · 0.65
persistMethod · 0.65
dismissMethod · 0.65
MediaPickerFunction · 0.65
deleteMethod · 0.65
subscribeMethod · 0.65
deleteMediaFunction · 0.65
loadMediaFunction · 0.65
collectAllMediaFunction · 0.65

Implementers 8

S3MediaStorepackages/next-tinacms-s3/src/s3-media-
AzureMediaStorepackages/next-tinacms-azure/src/azure-
CloudinaryMediaStorepackages/next-tinacms-cloudinary/src/c
DOSMediaStorepackages/next-tinacms-dos/src/dos-medi
MediaManagerpackages/tinacms/src/toolkit/core/medi
DummyMediaStorepackages/tinacms/src/toolkit/core/medi
TinaMediaStorepackages/tinacms/src/toolkit/core/medi
GitMediaStorepackages/tinacms/src/toolkit/git-clien

Calls

no outgoing calls

Tested by

no test coverage detected