fix(typing): add registerEventListener
to CMS interface (#4804)
This commit is contained in:
parent
567438fdd1
commit
5c265c1352
11
packages/netlify-cms-core/index.d.ts
vendored
11
packages/netlify-cms-core/index.d.ts
vendored
@ -403,6 +403,13 @@ declare module 'netlify-cms-core' {
|
|||||||
config?: CmsMediaLibraryOptions;
|
config?: CmsMediaLibraryOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CmsEventListener {
|
||||||
|
name: 'prePublish' | 'postPublish' | 'preUnpublish' | 'postUnpublish' | 'preSave' | 'postSave';
|
||||||
|
handler: { entry: Map<string, any>; author: { login: string; name: string } };
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CmsEventListenerOptions = any; // TODO: type properly
|
||||||
|
|
||||||
export type CmsLocalePhrases = any; // TODO: type properly
|
export type CmsLocalePhrases = any; // TODO: type properly
|
||||||
|
|
||||||
export interface CmsRegistry {
|
export interface CmsRegistry {
|
||||||
@ -455,6 +462,10 @@ declare module 'netlify-cms-core' {
|
|||||||
init: (options?: InitOptions) => void;
|
init: (options?: InitOptions) => void;
|
||||||
registerBackend: (name: string, backendClass: CmsBackendClass) => void;
|
registerBackend: (name: string, backendClass: CmsBackendClass) => void;
|
||||||
registerEditorComponent: (options: EditorComponentOptions) => void;
|
registerEditorComponent: (options: EditorComponentOptions) => void;
|
||||||
|
registerEventListener: (
|
||||||
|
eventListener: CmsEventListener,
|
||||||
|
options: CmsEventListenerOptions,
|
||||||
|
) => void;
|
||||||
registerLocale: (locale: string, phrases: CmsLocalePhrases) => void;
|
registerLocale: (locale: string, phrases: CmsLocalePhrases) => void;
|
||||||
registerMediaLibrary: (mediaLibrary: CmsMediaLibrary, options?: CmsMediaLibraryOptions) => void;
|
registerMediaLibrary: (mediaLibrary: CmsMediaLibrary, options?: CmsMediaLibraryOptions) => void;
|
||||||
registerPreviewStyle: (filePath: string, options?: PreviewStyleOptions) => void;
|
registerPreviewStyle: (filePath: string, options?: PreviewStyleOptions) => void;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user