@wixc3/board-core
Advanced tools
Comparing version 1.2.0 to 2.0.0
import type { IRenderableMetadataBase } from './types'; | ||
import { OmitGeneralMetadata } from './create-metadata'; | ||
export declare type OmitIRenderableMetadataBase<DATA extends IRenderableMetadataBase> = Omit<OmitGeneralMetadata<DATA>, 'setupStage' | 'cleanupStage'>; | ||
export declare function baseRender<DATA extends IRenderableMetadataBase>(data: DATA, render: (target: HTMLElement) => Promise<void>, canvas: HTMLElement): Promise<void>; | ||
export declare function baseRender<DATA extends IRenderableMetadataBase>(data: DATA, render: (target: HTMLElement) => Promise<() => void>, canvas: HTMLElement): Promise<() => void>; | ||
export declare function createRenderableBase<DATA extends IRenderableMetadataBase>(data: OmitIRenderableMetadataBase<DATA>): DATA; | ||
//# sourceMappingURL=create-renderable-base.d.ts.map |
@@ -9,4 +9,5 @@ "use strict"; | ||
(0, hooks_1.callHooks)(data, 'beforeRender', canvas); | ||
await render(canvas); | ||
const cleanup = await render(canvas); | ||
(0, hooks_1.callHooks)(data, 'afterRender', canvas); | ||
return cleanup; | ||
} | ||
@@ -13,0 +14,0 @@ exports.baseRender = baseRender; |
@@ -73,10 +73,8 @@ export declare type LayoutSize = number | undefined | null; | ||
/** | ||
* renders the Renderable into an html element | ||
* Renders the Renderable into an html element | ||
* | ||
* @returns a cleanup function | ||
*/ | ||
render: (targetElement: HTMLElement) => Promise<void>; | ||
render: (targetElement: HTMLElement) => Promise<() => void>; | ||
/** | ||
* cleans everything render does | ||
*/ | ||
cleanup: (targetElement: HTMLElement) => void; | ||
/** | ||
* sets the stage for the renderer. | ||
@@ -83,0 +81,0 @@ * this function has many side effects ( such as effecting window styles and sizes ) |
{ | ||
"name": "@wixc3/board-core", | ||
"description": "Types and helpers for component boards", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -13,8 +13,9 @@ import type { IRenderableMetadataBase } from './types'; | ||
data: DATA, | ||
render: (target: HTMLElement) => Promise<void>, | ||
render: (target: HTMLElement) => Promise<() => void>, | ||
canvas: HTMLElement | ||
): Promise<void> { | ||
): Promise<() => void> { | ||
callHooks<IRenderableMetadataBase, 'beforeRender'>(data, 'beforeRender', canvas); | ||
await render(canvas); | ||
const cleanup = await render(canvas); | ||
callHooks<IRenderableMetadataBase, 'afterRender'>(data, 'afterRender', canvas); | ||
return cleanup; | ||
} | ||
@@ -21,0 +22,0 @@ |
@@ -127,10 +127,8 @@ export type LayoutSize = number | undefined | null; | ||
/** | ||
* renders the Renderable into an html element | ||
* Renders the Renderable into an html element | ||
* | ||
* @returns a cleanup function | ||
*/ | ||
render: (targetElement: HTMLElement) => Promise<void>; | ||
render: (targetElement: HTMLElement) => Promise<() => void>; | ||
/** | ||
* cleans everything render does | ||
*/ | ||
cleanup: (targetElement: HTMLElement) => void; | ||
/** | ||
* sets the stage for the renderer. | ||
@@ -137,0 +135,0 @@ * this function has many side effects ( such as effecting window styles and sizes ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44867
656