Interface IContentProviderExperimental

The content provider interface.

Content providers are similar to drives, but instead of a data storage, they represent the data retrieval method (think protocol). Each drive can have multiple providers registered, and each provider ID can be used to register an instance of such provider across multiple drives.

To provision file contents via a content provider:

  • register a widget factory with contentProviderId option
  • register a file type with in the document registry with contentProviderId option
interface IContentProvider {
    fileChanged?: ISignal<IContentProvider, Contents.IChangedArgs>;
    sharedModelFactory?: ISharedFactory;
    get(localPath: string, options?: IFetchOptions): Promise<Contents.IModel>;
    save(
        localPath: string,
        options?: Partial<Contents.IModel> & IContentProvisionOptions,
    ): Promise<Contents.IModel>;
}

Hierarchy

  • Pick<IDrive, "get" | "save" | "sharedModelFactory">
    • IContentProvider

Implemented by

Properties

A signal emitted when a file operation takes place.

Content providers which perform save operations initiated on the backend may emit this signal to communicate a change in the file contents.

sharedModelFactory?: ISharedFactory

An optional shared model factory instance for the drive.

Methods