import { IRoot } from "../../../utils/types/root"; import { IMeta } from "../../ed/logic/ed-global"; import { viParts } from "./parts"; type ViStatus = "init" | "loading" | "ready"; export const ViGlobal = { ts: 0, status: "init" as ViStatus, meta: {} as Record, entry: [] as string[], tick: 0, mode: "desktop" as "mobile" | "desktop", site: { id: "", api_url: "", api: null as any, db: null as any, code: { mode: "old" as "old" | "vsc", }, }, site_url: null as unknown as URL, script: { init_local_effect: undefined as undefined | Record, }, visit: undefined as | undefined | ((meta: IMeta, parts: ReturnType) => void), on_status_changes: undefined as void | ((status: ViStatus) => void), layout: undefined as | { id: string; meta: Record; entry: string[]; } | undefined, page: { cur: { id: "" }, navs: {} as Record>, }, on_preload: undefined as | undefined | ((arg: { urls: string[]; opt: { on_load?: ( pages: { id: string; url: string; root: IRoot; }[] ) => void; }; }) => Promise), }; export type VG = typeof ViGlobal & { render: () => void };