UNPKG

kirbyuse

Version:

Collection of Vue Composition utilities for Kirby CMS

64 lines (63 loc) 5.26 kB
import { BlockComponentProps, ButtonTheme, DialogButtonProps, DialogFieldProps, DialogSize, FieldsDialogProps, isKirby4, isKirby5, useApi, useApp, useBlock, useContent, useDialog, useHelpers, useI18n, useLibrary, usePanel, useSection, useStore } from "./composables.js"; import { Panel } from "kirby-types"; import * as VueNamespace from "vue"; import { VueConstructor } from "vue"; //#region src/utils/env.d.ts declare function isLocalDev(): boolean; //#endregion //#region src/utils/logger.d.ts declare const LOG_LEVELS: { readonly error: 0; readonly warn: 1; readonly log: 2; readonly info: 3; readonly success: 3; }; type LogLevel = (typeof LOG_LEVELS)[keyof typeof LOG_LEVELS]; type LogType = keyof typeof LOG_LEVELS; interface LogEvent { level: LogLevel; type: LogType; tag: string; args: any[]; } type LogMethod = (...args: any[]) => void; interface Logger { error: LogMethod; warn: LogMethod; log: LogMethod; info: LogMethod; success: LogMethod; } declare function createLogger(tag: string): Logger; //#endregion //#region src/utils/plugin.d.ts interface PluginAsset { filename: string; url: string; } declare function registerPluginAssets(assets: PluginAsset[]): Promise<void>; declare function resolvePluginAsset(filename: string): PluginAsset; declare function loadPluginModule<T = any>(filename: string): Promise<T>; //#endregion //#region src/vue.d.ts type VueGlobal = VueConstructor & Omit<typeof VueNamespace, "default">; declare global { interface Window { Vue: VueGlobal; } } declare const globalVue: VueGlobal; //#endregion //#region src/index.d.ts declare global { interface Window { panel: Panel; } } declare const computed: typeof VueNamespace.computed, customRef: typeof VueNamespace.customRef, defineAsyncComponent: typeof VueNamespace.defineAsyncComponent, defineComponent: typeof VueNamespace.defineComponent, effectScope: typeof VueNamespace.effectScope, getCurrentInstance: typeof VueNamespace.getCurrentInstance, getCurrentScope: typeof VueNamespace.getCurrentScope, h: VueNamespace.CreateElement, inject: typeof VueNamespace.inject, isProxy: typeof VueNamespace.isProxy, isReactive: typeof VueNamespace.isReactive, isReadonly: typeof VueNamespace.isReadonly, isRef: typeof VueNamespace.isRef, isShallow: typeof VueNamespace.isShallow, markRaw: typeof VueNamespace.markRaw, nextTick: { <T>(callback: (this: T) => void, context?: T): void; (): Promise<void>; } & typeof VueNamespace.nextTick, onActivated: (fn: () => void, target?: any) => void, onBeforeMount: (fn: () => void, target?: any) => void, onBeforeUnmount: (fn: () => void, target?: any) => void, onBeforeUpdate: (fn: () => void, target?: any) => void, onDeactivated: (fn: () => void, target?: any) => void, onErrorCaptured: typeof VueNamespace.onErrorCaptured, onMounted: (fn: () => void, target?: any) => void, onRenderTracked: (fn: (e: VueNamespace.DebuggerEvent) => any, target?: any) => void, onRenderTriggered: (fn: (e: VueNamespace.DebuggerEvent) => any, target?: any) => void, onScopeDispose: typeof VueNamespace.onScopeDispose, onServerPrefetch: (fn: () => void, target?: any) => void, onUnmounted: (fn: () => void, target?: any) => void, onUpdated: (fn: () => void, target?: any) => void, provide: typeof VueNamespace.provide, proxyRefs: typeof VueNamespace.proxyRefs, reactive: typeof VueNamespace.reactive, readonly: typeof VueNamespace.readonly, ref: typeof VueNamespace.ref, shallowReactive: typeof VueNamespace.shallowReactive, shallowReadonly: typeof VueNamespace.shallowReadonly, shallowRef: typeof VueNamespace.shallowRef, toRaw: typeof VueNamespace.toRaw, toRef: typeof VueNamespace.toRef, toRefs: typeof VueNamespace.toRefs, triggerRef: typeof VueNamespace.triggerRef, unref: typeof VueNamespace.unref, useAttrs: typeof VueNamespace.useAttrs, useCssModule: typeof VueNamespace.useCssModule, useCssVars: typeof VueNamespace.useCssVars, useListeners: typeof VueNamespace.useListeners, useSlots: typeof VueNamespace.useSlots, watch: typeof VueNamespace.watch, watchEffect: typeof VueNamespace.watchEffect, watchPostEffect: typeof VueNamespace.watchPostEffect, watchSyncEffect: typeof VueNamespace.watchSyncEffect; //#endregion export { BlockComponentProps, ButtonTheme, DialogButtonProps, DialogFieldProps, DialogSize, FieldsDialogProps, LOG_LEVELS, LogEvent, LogLevel, LogMethod, LogType, Logger, PluginAsset, type VueGlobal, computed, createLogger, customRef, defineAsyncComponent, defineComponent, effectScope, getCurrentInstance, getCurrentScope, globalVue, h, inject, isKirby4, isKirby5, isLocalDev, isProxy, isReactive, isReadonly, isRef, isShallow, loadPluginModule, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref, registerPluginAssets, resolvePluginAsset, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useApi, useApp, useAttrs, useBlock, useContent, useCssModule, useCssVars, useDialog, useHelpers, useI18n, useLibrary, useListeners, usePanel, useSection, useSlots, useStore, watch, watchEffect, watchPostEffect, watchSyncEffect };