[skip ci] docs docs docs

This commit is contained in:
Vendicated 2022-11-25 19:25:35 +01:00
parent c2c6c9fccb
commit a85ec594a7
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
7 changed files with 63 additions and 33 deletions

View file

@ -76,14 +76,26 @@ const ModalAPI = mapMangledModuleLazy("onCloseRequest:null!=", {
openModalLazy: m => m?.length === 1 && filters.byCode(".apply(this,arguments)")(m),
});
/**
* Wait for the render promise to resolve, then open a modal with it.
* This is equivalent to render().then(openModal)
* You should use the Modal components exported by this file
*/
export function openModalLazy(render: () => Promise<RenderFunction>, options?: ModalOptions & { contextKey?: string; }): Promise<string> {
return ModalAPI.openModalLazy(render, options);
}
/**
* Open a Modal with the given render function.
* You should use the Modal components exported by this file
*/
export function openModal(render: RenderFunction, options?: ModalOptions, contextKey?: string): string {
return ModalAPI.openModal(render, options, contextKey);
}
/**
* Close a modal by its key
*/
export function closeModal(modalKey: string, contextKey?: string): void {
return ModalAPI.closeModal(modalKey, contextKey);
}