Socket
Socket
Sign inDemoInstall

vitepress

Package Overview
Dependencies
Maintainers
5
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vitepress - npm Package Compare versions

Comparing version 1.0.0-rc.8 to 1.0.0-rc.9

1450

dist/client/index.d.ts
import * as vue from 'vue';
import { Component, InjectionKey, Ref, App, AsyncComponentLoader } from 'vue';
import { PageData, Awaitable, SiteData } from '../../types/shared.js';
export { HeadConfig, Header, PageData, SiteData } from '../../types/shared.js';
import { Component as Component$1, InjectionKey as InjectionKey$1, Ref as Ref$1, App as App$1, AsyncComponentLoader } from 'vue';
import { UseDarkOptions } from '@vueuse/core';
/**
* SFC block that extracted from markdown
*/
interface SfcBlock {
/**
* The type of the block
*/
type: string;
/**
* The content, including open-tag and close-tag
*/
content: string;
/**
* The content that stripped open-tag and close-tag off
*/
contentStripped: string;
/**
* The open-tag
*/
tagOpen: string;
/**
* The close-tag
*/
tagClose: string;
}
interface MarkdownSfcBlocks {
/**
* The `<template>` block
*/
template: SfcBlock | null;
/**
* The common `<script>` block
*/
script: SfcBlock | null;
/**
* The `<script setup>` block
*/
scriptSetup: SfcBlock | null;
/**
* All `<script>` blocks.
*
* By default, SFC only allows one `<script>` block and one `<script setup>` block.
* However, some tools may support different types of `<script>`s, so we keep all of them here.
*/
scripts: SfcBlock[];
/**
* All `<style>` blocks.
*/
styles: SfcBlock[];
/**
* All custom blocks.
*/
customBlocks: SfcBlock[];
}
declare module '@mdit-vue/types' {
interface MarkdownItEnv {
/**
* SFC blocks that extracted by `@mdit-vue/plugin-sfc`
*/
sfcBlocks?: MarkdownSfcBlocks;
}
}
type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
type LooseRequired<T> = {
[P in keyof (T & Required<T>)]: T[P];
};
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
declare const ShallowReactiveMarker: unique symbol;
type CollectionTypes = IterableCollections | WeakCollections;
type IterableCollections = Map<any, any> | Set<any>;
type WeakCollections = WeakMap<any, any> | WeakSet<any>;
declare const enum TrackOpTypes {
GET = "get",
HAS = "has",
ITERATE = "iterate"
}
declare const enum TriggerOpTypes {
SET = "set",
ADD = "add",
DELETE = "delete",
CLEAR = "clear"
}
declare class EffectScope {
detached: boolean;
/* removed internal: _active */
/* removed internal: effects */
/* removed internal: cleanups */
/* removed internal: parent */
/* removed internal: scopes */
/* removed internal: index */
constructor(detached?: boolean);
get active(): boolean;
run<T>(fn: () => T): T | undefined;
/* removed internal: on */
/* removed internal: off */
stop(fromParent?: boolean): void;
}
type ComputedGetter<T> = (...args: any[]) => T;
type ComputedSetter<T> = (v: T) => void;
interface WritableComputedOptions<T> {
get: ComputedGetter<T>;
set: ComputedSetter<T>;
}
type EffectScheduler = (...args: any[]) => any;
type DebuggerEvent = {
effect: ReactiveEffect;
} & DebuggerEventExtraInfo;
type DebuggerEventExtraInfo = {
target: object;
type: TrackOpTypes | TriggerOpTypes;
key: any;
newValue?: any;
oldValue?: any;
oldTarget?: Map<any, any> | Set<any>;
};
declare class ReactiveEffect<T = any> {
fn: () => T;
scheduler: EffectScheduler | null;
active: boolean;
deps: Dep[];
parent: ReactiveEffect | undefined;
/* removed internal: computed */
/* removed internal: allowRecurse */
/* removed internal: deferStop */
onStop?: () => void;
onTrack?: (event: DebuggerEvent) => void;
onTrigger?: (event: DebuggerEvent) => void;
constructor(fn: () => T, scheduler?: EffectScheduler | null, scope?: EffectScope);
run(): T | undefined;
stop(): void;
}
interface DebuggerOptions {
onTrack?: (event: DebuggerEvent) => void;
onTrigger?: (event: DebuggerEvent) => void;
}
type Dep = Set<ReactiveEffect> & TrackedMarkers;
/**
* wasTracked and newTracked maintain the status for several levels of effect
* tracking recursion. One bit per level is used to define whether the dependency
* was/is tracked.
*/
type TrackedMarkers = {
/**
* wasTracked
*/
w: number;
/**
* newTracked
*/
n: number;
};
declare const RefSymbol: unique symbol;
declare const RawSymbol: unique symbol;
interface Ref<T = any> {
value: T;
/**
* Type differentiator only.
* We need this to be in public d.ts but don't want it to show up in IDE
* autocomplete, so we use a private Symbol instead.
*/
[RefSymbol]: true;
}
declare const ShallowRefMarker: unique symbol;
type ShallowRef<T = any> = Ref<T> & {
[ShallowRefMarker]?: true;
};
type BaseTypes = string | number | boolean;
/**
* This is a special exported interface for other packages to declare
* additional types that should bail out for ref unwrapping. For example
* \@vue/runtime-dom can declare it like so in its d.ts:
*
* ``` ts
* declare module '@vue/reactivity' {
* export interface RefUnwrapBailTypes {
* runtimeDOMBailTypes: Node | Window
* }
* }
* ```
*/
interface RefUnwrapBailTypes {
}
type ShallowUnwrapRef<T> = {
[K in keyof T]: T[K] extends Ref<infer V> ? V : T[K] extends Ref<infer V> | undefined ? unknown extends V ? undefined : V | undefined : T[K];
};
type UnwrapRef<T> = T extends ShallowRef<infer V> ? V : T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
type UnwrapRefSimple<T> = T extends Function | CollectionTypes | BaseTypes | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | {
[RawSymbol]?: true;
} ? T : T extends ReadonlyArray<any> ? {
[K in keyof T]: UnwrapRefSimple<T[K]>;
} : T extends object & {
[ShallowReactiveMarker]?: never;
} ? {
[P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>;
} : T;
type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
type InternalSlots = {
[name: string]: Slot | undefined;
};
type Slots = Readonly<InternalSlots>;
declare const SlotSymbol: unique symbol;
type SlotsType<T extends Record<string, any> = Record<string, any>> = {
[SlotSymbol]?: T;
};
type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T>;
type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{
[K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : Slot<T[K]>;
}>>;
type RawSlots = {
[name: string]: unknown;
$stable?: boolean;
/* removed internal: _ctx */
/* removed internal: _ */
};
interface SchedulerJob extends Function {
id?: number;
pre?: boolean;
active?: boolean;
computed?: boolean;
/**
* Indicates whether the effect is allowed to recursively trigger itself
* when managed by the scheduler.
*
* By default, a job cannot trigger itself because some built-in method calls,
* e.g. Array.prototype.push actually performs reads as well (#1740) which
* can lead to confusing infinite loops.
* The allowed cases are component update functions and watch callbacks.
* Component update functions may update child component props, which in turn
* trigger flush: "pre" watch callbacks that mutates state that the parent
* relies on (#1801). Watch callbacks doesn't track its dependencies so if it
* triggers itself again, it's likely intentional and it is the user's
* responsibility to perform recursive state mutation that eventually
* stabilizes (#1727).
*/
allowRecurse?: boolean;
/**
* Attached by renderer.ts when setting up a component's render effect
* Used to obtain component information when reporting max recursive updates.
* dev only.
*/
ownerInstance?: ComponentInternalInstance;
}
declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;
type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
type EmitsOptions = ObjectEmitsOptions | string[];
type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
[K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
} : T extends ObjectEmitsOptions ? {
[K in string & `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}` ? T[Uncapitalize<C>] extends null ? (...args: any[]) => any : (...args: T[Uncapitalize<C>] extends (...args: infer P) => any ? P : never) => any : never;
} : {};
type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V> ? (event: V, ...args: any[]) => void : {} extends Options ? (event: string, ...args: any[]) => void : UnionToIntersection<{
[key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : (event: key, ...args: any[]) => void;
}[Event]>;
/**
* Custom properties added to component instances in any way and can be accessed through `this`
*
* @example
* Here is an example of adding a property `$router` to every component instance:
* ```ts
* import { createApp } from 'vue'
* import { Router, createRouter } from 'vue-router'
*
* declare module '@vue/runtime-core' {
* interface ComponentCustomProperties {
* $router: Router
* }
* }
*
* // effectively adding the router to every component instance
* const app = createApp({})
* const router = createRouter()
* app.config.globalProperties.$router = router
*
* const vm = app.mount('#app')
* // we can access the router from the instance
* vm.$router.push('/')
* ```
*/
interface ComponentCustomProperties {
}
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults, any, any, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
type ExtractMixin<T> = {
Mixin: MixinToOptionTypes<T>;
}[T extends ComponentOptionsMixin ? 'Mixin' : never];
type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType<{}, {}, {}, {}, {}> : UnionToIntersection<ExtractMixin<T>>;
type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
type EnsureNonVoid<T> = T extends void ? {} : T;
type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
__isFragment?: never;
__isTeleport?: never;
__isSuspense?: never;
new (...args: any[]): T;
};
type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S>, I, S>;
type ComponentPublicInstance<P = {}, // props type extracted from props option
B = {}, // raw bindings returned from setup()
D = {}, // return from data()
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}> = {
$: ComponentInternalInstance;
$data: D;
$props: Prettify<MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps>;
$attrs: Data;
$refs: Data;
$slots: UnwrapSlotsType<S>;
$root: ComponentPublicInstance | null;
$parent: ComponentPublicInstance | null;
$emit: EmitFn<E>;
$el: any;
$options: Options & MergedComponentOptionsOverride;
$forceUpdate: () => void;
$nextTick: typeof nextTick;
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R]) => any : (...args: any) => any, options?: WatchOptions): WatchStopHandle;
} & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
interface SuspenseProps {
onResolve?: () => void;
onPending?: () => void;
onFallback?: () => void;
timeout?: string | number;
/**
* Allow suspense to be captured by parent suspense
*
* @default false
*/
suspensible?: boolean;
}
declare const SuspenseImpl: {
name: string;
__isSuspense: boolean;
process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void;
hydrate: typeof hydrateSuspense;
create: typeof createSuspenseBoundary;
normalize: typeof normalizeSuspenseChildren;
};
declare const Suspense: {
new (): {
$props: VNodeProps & SuspenseProps;
$slots: {
default(): VNode[];
fallback(): VNode[];
};
};
__isSuspense: true;
};
interface SuspenseBoundary {
vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
parent: SuspenseBoundary | null;
parentComponent: ComponentInternalInstance | null;
isSVG: boolean;
container: RendererElement;
hiddenContainer: RendererElement;
anchor: RendererNode | null;
activeBranch: VNode | null;
pendingBranch: VNode | null;
deps: number;
pendingId: number;
timeout: number;
isInFallback: boolean;
isHydrating: boolean;
isUnmounted: boolean;
effects: Function[];
resolve(force?: boolean, sync?: boolean): void;
fallback(fallbackVNode: VNode): void;
move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
next(): RendererNode | null;
registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn): void;
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
}
declare function createSuspenseBoundary(vnode: VNode, parentSuspense: SuspenseBoundary | null, parentComponent: ComponentInternalInstance | null, container: RendererElement, hiddenContainer: RendererElement, anchor: RendererNode | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, isHydrating?: boolean): SuspenseBoundary;
declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
declare function normalizeSuspenseChildren(vnode: VNode): void;
interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, isSVG?: boolean, prevChildren?: VNode<HostNode, HostElement>[], parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, unmountChildren?: UnmountChildrenFn): void;
insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
remove(el: HostNode): void;
createElement(type: string, isSVG?: boolean, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
[key: string]: any;
}) | null): HostElement;
createText(text: string): HostNode;
createComment(text: string): HostNode;
setText(node: HostNode, text: string): void;
setElementText(node: HostElement, text: string): void;
parentNode(node: HostNode): HostElement | null;
nextSibling(node: HostNode): HostNode | null;
querySelector?(selector: string): HostElement | null;
setScopeId?(el: HostElement, id: string): void;
cloneNode?(node: HostNode): HostNode;
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, isSVG: boolean, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
}
interface RendererNode {
[key: string]: any;
}
interface RendererElement extends RendererNode {
}
interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
p: PatchFn;
um: UnmountFn;
r: RemoveFn;
m: MoveFn;
mt: MountComponentFn;
mc: MountChildrenFn;
pc: PatchChildrenFn;
pbc: PatchBlockChildrenFn;
n: NextFn;
o: RendererOptions<HostNode, HostElement>;
}
type PatchFn = (n1: VNode | null, // null means this is a mount
n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, isSVG?: boolean, slotScopeIds?: string[] | null, optimized?: boolean) => void;
type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void;
type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean) => void;
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null) => void;
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
type NextFn = (vnode: VNode) => RendererNode | null;
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
type RemoveFn = (vnode: VNode) => void;
type UnmountChildrenFn = (children: VNode[], parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean, start?: number) => void;
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
declare const enum MoveType {
ENTER = 0,
LEAVE = 1,
REORDER = 2
}
type DebuggerHook = (e: DebuggerEvent) => void;
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
type ComponentObjectPropsOptions<P = Data> = {
[K in keyof P]: Prop<P[K]> | null;
};
type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
type DefaultFactory<T> = (props: Data) => T | null | undefined;
interface PropOptions<T = any, D = T> {
type?: PropType<T> | true | null;
required?: boolean;
default?: D | DefaultFactory<D> | null | undefined | object;
validator?(value: unknown): boolean;
/* removed internal: skipCheck */
/* removed internal: skipFactory */
}
type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
type PropConstructor<T = any> = {
new (...args: any[]): T & {};
} | {
(): T;
} | PropMethod<T>;
type PropMethod<T, TConstructor = any> = [T] extends [
((...args: any) => any) | undefined
] ? {
new (): TConstructor;
(): T;
readonly prototype: TConstructor;
} : never;
type RequiredKeys<T> = {
[K in keyof T]: T[K] extends {
required: true;
} | {
default: any;
} | BooleanConstructor | {
type: BooleanConstructor;
} ? T[K] extends {
default: undefined | (() => undefined);
} ? never : K : never;
}[keyof T];
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
type: null | true;
}] ? any : [T] extends [ObjectConstructor | {
type: ObjectConstructor;
}] ? Record<string, any> : [T] extends [BooleanConstructor | {
type: BooleanConstructor;
}] ? boolean : [T] extends [DateConstructor | {
type: DateConstructor;
}] ? Date : [T] extends [(infer U)[] | {
type: (infer U)[];
}] ? U extends DateConstructor ? Date | InferPropType<U> : InferPropType<U> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? IfAny<V, V, D> : V : T;
/**
* Extract prop types from a runtime props options object.
* The extracted types are **internal** - i.e. the resolved props received by
* the component.
* - Boolean props are always present
* - Props with default values are always present
*
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
*/
type ExtractPropTypes<O> = {
[K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
} & {
[K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
};
/**
Runtime helper for applying directives to a vnode. Example usage:
const comp = resolveComponent('comp')
const foo = resolveDirective('foo')
const bar = resolveDirective('bar')
return withDirectives(h(comp), [
[foo, this.x],
[bar, this.y]
])
*/
interface DirectiveBinding<V = any> {
instance: ComponentPublicInstance | null;
value: V;
oldValue: V | null;
arg?: string;
modifiers: DirectiveModifiers;
dir: ObjectDirective<any, V>;
}
type DirectiveHook<T = any, Prev = VNode<any, T> | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode<any, T>, prevVNode: Prev) => void;
type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
interface ObjectDirective<T = any, V = any> {
created?: DirectiveHook<T, null, V>;
beforeMount?: DirectiveHook<T, null, V>;
mounted?: DirectiveHook<T, null, V>;
beforeUpdate?: DirectiveHook<T, VNode<any, T>, V>;
updated?: DirectiveHook<T, VNode<any, T>, V>;
beforeUnmount?: DirectiveHook<T, null, V>;
unmounted?: DirectiveHook<T, null, V>;
getSSRProps?: SSRDirectiveHook;
deep?: boolean;
}
type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
type DirectiveModifiers = Record<string, boolean>;
declare const enum DeprecationTypes {
GLOBAL_MOUNT = "GLOBAL_MOUNT",
GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
GLOBAL_EXTEND = "GLOBAL_EXTEND",
GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE",
GLOBAL_SET = "GLOBAL_SET",
GLOBAL_DELETE = "GLOBAL_DELETE",
GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE",
GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL",
CONFIG_SILENT = "CONFIG_SILENT",
CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS",
CONFIG_KEY_CODES = "CONFIG_KEY_CODES",
CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP",
CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS",
CONFIG_WHITESPACE = "CONFIG_WHITESPACE",
CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS",
INSTANCE_SET = "INSTANCE_SET",
INSTANCE_DELETE = "INSTANCE_DELETE",
INSTANCE_DESTROY = "INSTANCE_DESTROY",
INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER",
INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS",
INSTANCE_CHILDREN = "INSTANCE_CHILDREN",
INSTANCE_LISTENERS = "INSTANCE_LISTENERS",
INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS",
INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE",
OPTIONS_DATA_FN = "OPTIONS_DATA_FN",
OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE",
OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY",
OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
WATCH_ARRAY = "WATCH_ARRAY",
PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
CUSTOM_DIR = "CUSTOM_DIR",
ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION",
TRANSITION_CLASSES = "TRANSITION_CLASSES",
TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT",
COMPONENT_ASYNC = "COMPONENT_ASYNC",
COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL",
COMPONENT_V_MODEL = "COMPONENT_V_MODEL",
RENDER_FUNCTION = "RENDER_FUNCTION",
FILTERS = "FILTERS",
PRIVATE_APIS = "PRIVATE_APIS"
}
type CompatConfig = Partial<Record<DeprecationTypes, boolean | 'suppress-warning'>> & {
MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
};
/**
* Interface for declaring custom options.
*
* @example
* ```ts
* declare module '@vue/runtime-core' {
* interface ComponentCustomOptions {
* beforeRouteUpdate?(
* to: Route,
* from: Route,
* next: () => void
* ): void
* }
* }
* ```
*/
interface ComponentCustomOptions {
}
type RenderFunction = () => VNodeChild;
interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>, ComponentInternalOptions, ComponentCustomOptions {
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
name?: string;
template?: string | object;
render?: Function;
components?: Record<string, Component>;
directives?: Record<string, Directive>;
inheritAttrs?: boolean;
emits?: (E | EE[]) & ThisType<void>;
slots?: S;
expose?: string[];
serverPrefetch?(): void | Promise<any>;
compilerOptions?: RuntimeCompilerOptions;
/* removed internal: ssrRender */
/* removed internal: __ssrInlineRender */
/* removed internal: __asyncLoader */
/* removed internal: __asyncResolved */
call?: (this: unknown, ...args: unknown[]) => never;
__isFragment?: never;
__isTeleport?: never;
__isSuspense?: never;
__defaults?: Defaults;
}
/**
* Subset of compiler options that makes sense for the runtime.
*/
interface RuntimeCompilerOptions {
isCustomElement?: (tag: string) => boolean;
whitespace?: 'preserve' | 'condense';
comments?: boolean;
delimiters?: [string, string];
}
type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S> & {
props?: undefined;
} & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I, S>>;
type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any, S extends SlotsType = any> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, string, S> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>;
type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any>;
type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
interface MethodOptions {
[key: string]: Function;
}
type ExtractComputedReturns<T extends any> = {
[key in keyof T]: T[key] extends {
get: (...args: any[]) => infer TReturn;
} ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
};
type ObjectWatchOptionItem = {
handler: WatchCallback | string;
} & WatchOptions;
type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
type ComponentProvideOptions = ObjectProvideOptions | Function;
type ObjectProvideOptions = Record<string | symbol, unknown>;
type ComponentInjectOptions = string[] | ObjectInjectOptions;
type ObjectInjectOptions = Record<string | symbol, string | symbol | {
from?: string | symbol;
default?: unknown;
}>;
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
[K in T[number]]?: unknown;
} : T extends ObjectInjectOptions ? {
[K in keyof T]?: unknown;
} : never;
interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string> {
compatConfig?: CompatConfig;
[key: string]: any;
data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
computed?: C;
methods?: M;
watch?: ComponentWatchOptions;
provide?: ComponentProvideOptions;
inject?: I | II[];
filters?: Record<string, Function>;
mixins?: Mixin[];
extends?: Extends;
beforeCreate?(): void;
created?(): void;
beforeMount?(): void;
mounted?(): void;
beforeUpdate?(): void;
updated?(): void;
activated?(): void;
deactivated?(): void;
/** @deprecated use `beforeUnmount` instead */
beforeDestroy?(): void;
beforeUnmount?(): void;
/** @deprecated use `unmounted` instead */
destroyed?(): void;
unmounted?(): void;
renderTracked?: DebuggerHook;
renderTriggered?: DebuggerHook;
errorCaptured?: ErrorCapturedHook;
/**
* runtime compile only
* @deprecated use `compilerOptions.delimiters` instead.
*/
delimiters?: [string, string];
/**
* #3468
*
* type-only, used to assist Mixin's type inference,
* typescript will try to simplify the inferred `Mixin` type,
* with the `__differentiator`, typescript won't be able to combine different mixins,
* because the `__differentiator` will be different
*/
__differentiator?: keyof D | keyof C | keyof M;
}
type MergedHook<T = () => void> = T | T[];
type MergedComponentOptionsOverride = {
beforeCreate?: MergedHook;
created?: MergedHook;
beforeMount?: MergedHook;
mounted?: MergedHook;
beforeUpdate?: MergedHook;
updated?: MergedHook;
activated?: MergedHook;
deactivated?: MergedHook;
/** @deprecated use `beforeUnmount` instead */
beforeDestroy?: MergedHook;
beforeUnmount?: MergedHook;
/** @deprecated use `unmounted` instead */
destroyed?: MergedHook;
unmounted?: MergedHook;
renderTracked?: MergedHook<DebuggerHook>;
renderTriggered?: MergedHook<DebuggerHook>;
errorCaptured?: MergedHook<ErrorCapturedHook>;
};
type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
P: P;
B: B;
D: D;
C: C;
M: M;
Defaults: Defaults;
};
interface InjectionKey<T> extends Symbol {
}
interface App<HostElement = any> {
version: string;
config: AppConfig;
use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): this;
use<Options>(plugin: Plugin<Options>, options: Options): this;
mixin(mixin: ComponentOptions): this;
component(name: string): Component | undefined;
component(name: string, component: Component): this;
directive(name: string): Directive | undefined;
directive(name: string, directive: Directive): this;
mount(rootContainer: HostElement | string, isHydrate?: boolean, isSVG?: boolean): ComponentPublicInstance;
unmount(): void;
provide<T>(key: InjectionKey<T> | string, value: T): this;
/**
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
* to variables provided via `app.provide()`.
*
* @param fn - function to run with the app as active instance
*/
runWithContext<T>(fn: () => T): T;
_uid: number;
_component: ConcreteComponent;
_props: Data | null;
_container: HostElement | null;
_context: AppContext;
_instance: ComponentInternalInstance | null;
/**
* v2 compat only
*/
filter?(name: string): Function | undefined;
filter?(name: string, filter: Function): this;
/* removed internal: _createRoot */
}
type OptionMergeFunction = (to: unknown, from: unknown) => any;
interface AppConfig {
readonly isNativeTag?: (tag: string) => boolean;
performance: boolean;
optionMergeStrategies: Record<string, OptionMergeFunction>;
globalProperties: ComponentCustomProperties & Record<string, any>;
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
/**
* Options to pass to `@vue/compiler-dom`.
* Only supported in runtime compiler build.
*/
compilerOptions: RuntimeCompilerOptions;
/**
* @deprecated use config.compilerOptions.isCustomElement
*/
isCustomElement?: (tag: string) => boolean;
/**
* Temporary config for opt-in to unwrap injected refs.
* @deprecated this no longer has effect. 3.3 always unwraps injected refs.
*/
unwrapInjectedRef?: boolean;
}
interface AppContext {
app: App;
config: AppConfig;
mixins: ComponentOptions[];
components: Record<string, Component>;
directives: Record<string, Directive>;
provides: Record<string | symbol, any>;
/* removed internal: optionsCache */
/* removed internal: propsCache */
/* removed internal: emitsCache */
/* removed internal: reload */
/* removed internal: filters */
}
type PluginInstallFunction<Options> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
install?: PluginInstallFunction<Options>;
}) | {
install: PluginInstallFunction<Options>;
};
type Hook<T = () => void> = T | T[];
interface BaseTransitionProps<HostElement = RendererElement> {
mode?: 'in-out' | 'out-in' | 'default';
appear?: boolean;
persisted?: boolean;
onBeforeEnter?: Hook<(el: HostElement) => void>;
onEnter?: Hook<(el: HostElement, done: () => void) => void>;
onAfterEnter?: Hook<(el: HostElement) => void>;
onEnterCancelled?: Hook<(el: HostElement) => void>;
onBeforeLeave?: Hook<(el: HostElement) => void>;
onLeave?: Hook<(el: HostElement, done: () => void) => void>;
onAfterLeave?: Hook<(el: HostElement) => void>;
onLeaveCancelled?: Hook<(el: HostElement) => void>;
onBeforeAppear?: Hook<(el: HostElement) => void>;
onAppear?: Hook<(el: HostElement, done: () => void) => void>;
onAfterAppear?: Hook<(el: HostElement) => void>;
onAppearCancelled?: Hook<(el: HostElement) => void>;
}
interface TransitionHooks<HostElement = RendererElement> {
mode: BaseTransitionProps['mode'];
persisted: boolean;
beforeEnter(el: HostElement): void;
enter(el: HostElement): void;
leave(el: HostElement, remove: () => void): void;
clone(vnode: VNode): TransitionHooks<HostElement>;
afterLeave?(): void;
delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
delayedLeave?(): void;
}
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
interface TeleportProps {
to: string | RendererElement | null | undefined;
disabled?: boolean;
}
declare const TeleportImpl: {
__isTeleport: boolean;
process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: Boolean): void;
move: typeof moveTeleport;
hydrate: typeof hydrateTeleport;
};
declare const enum TeleportMoveTypes {
TARGET_CHANGE = 0,
TOGGLE = 1,
REORDER = 2
}
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector } }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
declare const Teleport: {
new (): {
$props: VNodeProps & TeleportProps;
$slots: {
default(): VNode[];
};
};
__isTeleport: true;
};
/* removed internal: resolveFilter$1 */
declare const Fragment: {
new (): {
$props: VNodeProps;
};
__isFragment: true;
};
declare const Text: unique symbol;
declare const Comment: unique symbol;
declare const Static: unique symbol;
type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
type VNodeNormalizedRefAtom = {
i: ComponentInternalInstance;
r: VNodeRef;
k?: string;
f?: boolean;
};
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
type VNodeMountHook = (vnode: VNode) => void;
type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
type VNodeProps = {
key?: string | number | symbol;
ref?: VNodeRef;
ref_for?: boolean;
ref_key?: string;
onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
};
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
[key: string]: any;
}> {
/* removed internal: __v_isVNode */
type: VNodeTypes;
props: (VNodeProps & ExtraProps) | null;
key: string | number | symbol | null;
ref: VNodeNormalizedRef | null;
/**
* SFC only. This is assigned on vnode creation using currentScopeId
* which is set alongside currentRenderingInstance.
*/
scopeId: string | null;
/* removed internal: slotScopeIds */
children: VNodeNormalizedChildren;
component: ComponentInternalInstance | null;
dirs: DirectiveBinding[] | null;
transition: TransitionHooks<HostElement> | null;
el: HostNode | null;
anchor: HostNode | null;
target: HostElement | null;
targetAnchor: HostNode | null;
/* removed internal: staticCount */
suspense: SuspenseBoundary | null;
/* removed internal: ssContent */
/* removed internal: ssFallback */
shapeFlag: number;
patchFlag: number;
/* removed internal: dynamicProps */
/* removed internal: dynamicChildren */
appContext: AppContext | null;
/* removed internal: ctx */
/* removed internal: memo */
/* removed internal: isCompatRoot */
/* removed internal: ce */
}
type Data = Record<string, unknown>;
interface ComponentInternalOptions {
/* removed internal: __scopeId */
/* removed internal: __cssModules */
/* removed internal: __hmrId */
/**
* Compat build only, for bailing out of certain compatibility behavior
*/
__isBuiltIn?: boolean;
/**
* This one should be exposed so that devtools can make use of it
*/
__file?: string;
/**
* name inferred from filename
*/
__name?: string;
}
interface FunctionalComponent<P = {}, E extends EmitsOptions = {}, S extends Record<string, any> = any> extends ComponentInternalOptions {
(props: P, ctx: Omit<SetupContext<E, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
props?: ComponentPropsOptions<P>;
emits?: E | (keyof E)[];
slots?: IfAny<S, Slots, SlotsType<S>>;
inheritAttrs?: boolean;
displayName?: string;
compatConfig?: CompatConfig;
}
/**
* Concrete component type matches its actual value: it's either an options
* object, or a function. Use this where the code expects to work with actual
* values, e.g. checking if its a function or not. This is mostly for internal
* implementation code.
*/
type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, any, any>;
/**
* A type used in public APIs where a component type is expected.
* The constructor type is an artificial type returned by defineComponent().
*/
type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ConcreteComponent<Props, RawBindings, D, C, M> | ComponentPublicInstanceConstructor<Props>;
type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
attrs: Data;
slots: UnwrapSlotsType<S>;
emit: EmitFn<E>;
expose: (exposed?: Record<string, any>) => void;
} : never;
/* removed internal: InternalRenderFunction */
/**
* We expose a subset of properties on the internal instance as they are
* useful for advanced external libraries and tools.
*/
interface ComponentInternalInstance {
uid: number;
type: ConcreteComponent;
parent: ComponentInternalInstance | null;
root: ComponentInternalInstance;
appContext: AppContext;
/**
* Vnode representing this component in its parent's vdom tree
*/
vnode: VNode;
/* removed internal: next */
/**
* Root vnode of this component's own vdom tree
*/
subTree: VNode;
/**
* Render effect instance
*/
effect: ReactiveEffect;
/**
* Bound effect runner to be passed to schedulers
*/
update: SchedulerJob;
/* removed internal: render */
/* removed internal: ssrRender */
/* removed internal: provides */
/* removed internal: scope */
/* removed internal: accessCache */
/* removed internal: renderCache */
/* removed internal: components */
/* removed internal: directives */
/* removed internal: filters */
/* removed internal: propsOptions */
/* removed internal: emitsOptions */
/* removed internal: inheritAttrs */
/* removed internal: isCE */
/* removed internal: ceReload */
proxy: ComponentPublicInstance | null;
exposed: Record<string, any> | null;
exposeProxy: Record<string, any> | null;
/* removed internal: withProxy */
/* removed internal: ctx */
data: Data;
props: Data;
attrs: Data;
slots: InternalSlots;
refs: Data;
emit: EmitFn;
attrsProxy: Data | null;
slotsProxy: Slots | null;
/* removed internal: emitted */
/* removed internal: propsDefaults */
/* removed internal: setupState */
/* removed internal: devtoolsRawSetupState */
/* removed internal: setupContext */
/* removed internal: suspense */
/* removed internal: suspenseId */
/* removed internal: asyncDep */
/* removed internal: asyncResolved */
isMounted: boolean;
isUnmounted: boolean;
isDeactivated: boolean;
/* removed internal: f */
/* removed internal: n */
/* removed internal: ut */
}
type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
type OnCleanup = (cleanupFn: () => void) => void;
interface WatchOptionsBase extends DebuggerOptions {
flush?: 'pre' | 'post' | 'sync';
}
interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
immediate?: Immediate;
deep?: boolean;
}
type WatchStopHandle = () => void;
/**
* Vue `<script setup>` compiler macro for declaring component props. The
* expected argument is the same as the component `props` option.
*
* Example runtime declaration:
* ```js
* // using Array syntax
* const props = defineProps(['foo', 'bar'])
* // using Object syntax
* const props = defineProps({
* foo: String,
* bar: {
* type: Number,
* required: true
* }
* })
* ```
*
* Equivalent type-based declaration:
* ```ts
* // will be compiled into equivalent runtime declarations
* const props = defineProps<{
* foo?: string
* bar: number
* }>()
*
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
* ```
*
* This is only usable inside `<script setup>`, is compiled away in the
* output and should **not** be actually called at runtime.
*/
declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
[key in PropNames]?: any;
}>>;
declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
declare function defineProps<TypeProps>(): DefineProps<TypeProps, BooleanKey<TypeProps>>;
type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
readonly [K in BKeys]-?: boolean;
};
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
/**
* Vue `<script setup>` compiler macro for declaring a component's emitted
* events. The expected argument is the same as the component `emits` option.
*
* Example runtime declaration:
* ```js
* const emit = defineEmits(['change', 'update'])
* ```
*
* Example type-based declaration:
* ```ts
* const emit = defineEmits<{
* (event: 'change'): void
* (event: 'update', id: number): void
* }>()
*
* emit('change')
* emit('update', 1)
* ```
*
* This is only usable inside `<script setup>`, is compiled away in the
* output and should **not** be actually called at runtime.
*
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
*/
declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
declare function defineEmits<T extends ((...args: any[]) => any) | Record<string, any[]>>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
[K in keyof T]: (evt: K, ...args: T[K]) => void;
}>>;
/**
* Vue `<script setup>` compiler macro for declaring a component's exposed
* instance properties when it is accessed by a parent component via template
* refs.
*
* `<script setup>` components are closed by default - i.e. variables inside
* the `<script setup>` scope is not exposed to parent unless explicitly exposed
* via `defineExpose`.
*
* This is only usable inside `<script setup>`, is compiled away in the
* output and should **not** be actually called at runtime.
*
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
*/
declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
/**
* Vue `<script setup>` compiler macro for declaring a component's additional
* options. This should be used only for options that cannot be expressed via
* Composition API - e.g. `inheritAttrs`.
*
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
*/
declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin>(options?: ComponentOptionsWithoutProps<{}, RawBindings, D, C, M, Mixin, Extends> & {
emits?: undefined;
expose?: undefined;
slots?: undefined;
}): void;
declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
/**
* (**Experimental**) Vue `<script setup>` compiler macro for declaring a
* two-way binding prop that can be consumed via `v-model` from the parent
* component. This will declare a prop with the same name and a corresponding
* `update:propName` event.
*
* If the first argument is a string, it will be used as the prop name;
* Otherwise the prop name will default to "modelValue". In both cases, you
* can also pass an additional object which will be used as the prop's options.
*
* The options object can also specify an additional option, `local`. When set
* to `true`, the ref can be locally mutated even if the parent did not pass
* the matching `v-model`.
*
* @example
* ```ts
* // default model (consumed via `v-model`)
* const modelValue = defineModel<string>()
* modelValue.value = "hello"
*
* // default model with options
* const modelValue = defineModel<stirng>({ required: true })
*
* // with specified name (consumed via `v-model:count`)
* const count = defineModel<number>('count')
* count.value++
*
* // with specified name and default value
* const count = defineModel<number>('count', { default: 0 })
*
* // local mutable model, can be mutated locally
* // even if the parent did not pass the matching `v-model`.
* const count = defineModel<number>('count', { local: true, default: 0 })
* ```
*/
declare function defineModel<T>(options: {
required: true;
} & PropOptions<T> & DefineModelOptions): Ref<T>;
declare function defineModel<T>(options: {
default: any;
} & PropOptions<T> & DefineModelOptions): Ref<T>;
declare function defineModel<T>(options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
declare function defineModel<T>(name: string, options: {
required: true;
} & PropOptions<T> & DefineModelOptions): Ref<T>;
declare function defineModel<T>(name: string, options: {
default: any;
} & PropOptions<T> & DefineModelOptions): Ref<T>;
declare function defineModel<T>(name: string, options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
interface DefineModelOptions {
local?: boolean;
}
type NotUndefined<T> = T extends undefined ? never : T;
type InferDefaults<T> = {
[K in keyof T]?: InferDefault<T, T[K]>;
};
type NativeType = null | number | string | boolean | symbol | Function;
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Omit<T, keyof Defaults> & {
[K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
} & {
readonly [K in BKeys]-?: boolean;
};
/**
* Vue `<script setup>` compiler macro for providing props default values when
* using type-based `defineProps` declaration.
*
* Example usage:
* ```ts
* withDefaults(defineProps<{
* size?: number
* labels?: string[]
* }>(), {
* size: 3,
* labels: () => ['default label']
* })
* ```
*
* This is only usable inside `<script setup>`, is compiled away in the output
* and should **not** be actually called at runtime.
*
* @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
*/
declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
declare module '@vue/reactivity' {
interface RefUnwrapBailTypes {
runtimeCoreBailTypes: VNode | {
$: ComponentInternalInstance;
};
}
}
// Note: this file is auto concatenated to the end of the bundled d.ts during
// build.
type _defineProps = typeof defineProps
type _defineEmits = typeof defineEmits
type _defineExpose = typeof defineExpose
type _defineOptions = typeof defineOptions
type _defineSlots = typeof defineSlots
type _defineModel = typeof defineModel
type _withDefaults = typeof withDefaults
declare global {
const defineProps: _defineProps
const defineEmits: _defineEmits
const defineExpose: _defineExpose
const defineOptions: _defineOptions
const defineSlots: _defineSlots
const defineModel: _defineModel
const withDefaults: _withDefaults
}
// types shared between server and client
type Awaitable<T> = T | PromiseLike<T>
interface PageData {
relativePath: string
filePath: string // differs from relativePath in case of path rewrites
title: string
titleTemplate?: string | boolean
description: string
headers: Header[]
frontmatter: Record<string, any>
params?: Record<string, any>
isNotFound?: boolean
lastUpdated?: number
}
interface Header {
/**
* The level of the header
*
* `1` to `6` for `<h1>` to `<h6>`
*/
level: number
/**
* The title of the header
*/
title: string
/**
* The slug of the header
*
* Typically the `id` attr of the header anchor
*/
slug: string
/**
* Link of the header
*
* Typically using `#${slug}` as the anchor hash
*/
link: string
/**
* The children of the header
*/
children: Header[]
}
interface SiteData<ThemeConfig = any> {
base: string
cleanUrls?: boolean
lang: string
dir: string
title: string
titleTemplate?: string | boolean
description: string
head: HeadConfig[]
appearance:
| boolean
| 'dark'
| (Omit<UseDarkOptions, 'initialValue'> & { initialValue?: 'dark' })
themeConfig: ThemeConfig
scrollOffset:
| number
| string
| string[]
| { selector: string | string[]; padding: number }
locales: LocaleConfig<ThemeConfig>
localeIndex?: string
contentProps?: Record<string, any>
}
type HeadConfig =
| [string, Record<string, string>]
| [string, Record<string, string>, string]
interface LocaleSpecificConfig<ThemeConfig = any> {
lang?: string
dir?: string
title?: string
titleTemplate?: string | boolean
description?: string
head?: HeadConfig[]
themeConfig?: ThemeConfig
}
type LocaleConfig<ThemeConfig = any> = Record<
string,
LocaleSpecificConfig<ThemeConfig> & { label: string; link?: string }
>
declare const inBrowser: boolean;

@@ -11,3 +1419,3 @@

data: PageData;
component: Component | null;
component: Component$1 | null;
}

@@ -40,3 +1448,3 @@ interface Router {

declare const dataSymbol: InjectionKey<VitePressData>;
declare const dataSymbol: InjectionKey$1<VitePressData>;
interface VitePressData<T = any> {

@@ -46,25 +1454,25 @@ /**

*/
site: Ref<SiteData<T>>;
site: Ref$1<SiteData<T>>;
/**
* themeConfig from .vitepress/config.js
*/
theme: Ref<T>;
theme: Ref$1<T>;
/**
* Page-level metadata
*/
page: Ref<PageData>;
page: Ref$1<PageData>;
/**
* page frontmatter data
*/
frontmatter: Ref<PageData['frontmatter']>;
frontmatter: Ref$1<PageData['frontmatter']>;
/**
* dynamic route params
*/
params: Ref<PageData['params']>;
title: Ref<string>;
description: Ref<string>;
lang: Ref<string>;
isDark: Ref<boolean>;
dir: Ref<string>;
localeIndex: Ref<string>;
params: Ref$1<PageData['params']>;
title: Ref$1<string>;
description: Ref$1<string>;
lang: Ref$1<string>;
isDark: Ref$1<boolean>;
dir: Ref$1<string>;
localeIndex: Ref$1<string>;
}

@@ -74,8 +1482,8 @@ declare function useData<T = any>(): VitePressData<T>;

interface EnhanceAppContext {
app: App;
app: App$1;
router: Router;
siteData: Ref<SiteData>;
siteData: Ref$1<SiteData>;
}
interface Theme {
Layout?: Component;
Layout?: Component$1;
enhanceApp?: (ctx: EnhanceAppContext) => Awaitable<void>;

@@ -90,3 +1498,3 @@ extends?: Theme;

*/
NotFound?: Component;
NotFound?: Component$1;
}

@@ -125,2 +1533,2 @@

export { Content, type EnhanceAppContext, type Route, type Router, type Theme, type VitePressData, dataSymbol, defineClientComponent, inBrowser, onContentUpdated, useData, useRoute, useRouter, withBase };
export { Content, type EnhanceAppContext, type HeadConfig, type Header, type PageData, type Route, type Router, type SiteData, type Theme, type VitePressData, dataSymbol, defineClientComponent, inBrowser, onContentUpdated, useData, useRoute, useRouter, withBase };

2

dist/node/cli.js

@@ -298,3 +298,3 @@ import { a as getDefaultExportFromCjs, p as c, q as clearCache, n as init, l as build, s as serve, k as createServer } from './serve-05aeef7d.js';

var version = "1.0.0-rc.8";
var version = "1.0.0-rc.9";

@@ -301,0 +301,0 @@ function bindShortcuts(server, createDevServer) {

{
"name": "vitepress",
"version": "1.0.0-rc.8",
"version": "1.0.0-rc.9",
"description": "Vite & Vue powered static site generator",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc