Fix type of Hpml.pageVarUpdatedCallback (#6995)

This commit is contained in:
marihachi 2020-12-19 21:09:23 +09:00 committed by GitHub
parent 264f838669
commit 2eeeb0ed36
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ export class Hpml {
private pageVars: PageVar[]; private pageVars: PageVar[];
private envVars: Record<keyof typeof envVarsDef, any>; private envVars: Record<keyof typeof envVarsDef, any>;
public aiscript?: AiScript; public aiscript?: AiScript;
private pageVarUpdatedCallback; public pageVarUpdatedCallback?: values.VFn;
public canvases: Record<string, HTMLCanvasElement> = {}; public canvases: Record<string, HTMLCanvasElement> = {};
public vars: Ref<Record<string, any>> = ref({}); public vars: Ref<Record<string, any>> = ref({});
public page: Record<string, any>; public page: Record<string, any>;

View file

@ -19,7 +19,7 @@ Chart.pluginService.register({
export function initLib(hpml: Hpml) { export function initLib(hpml: Hpml) {
return { return {
'MkPages:updated': values.FN_NATIVE(([callback]) => { 'MkPages:updated': values.FN_NATIVE(([callback]) => {
hpml.pageVarUpdatedCallback = callback; hpml.pageVarUpdatedCallback = (callback as values.VFn);
}), }),
'MkPages:get_canvas': values.FN_NATIVE(([id]) => { 'MkPages:get_canvas': values.FN_NATIVE(([id]) => {
utils.assertString(id); utils.assertString(id);