import type KNode from 'core/kdom/knode' import type Watcher from 'core/observer/watcher' import { ComponentOptions } from './options' import { SetupContext } from 'v3/apiSetup' import { ScopedSlotsData, KNodeChildren, KNodeData } from './knode' import { GlobalAPI } from './global-api' import { EffectScope } from 'v3/reactivity/effectScope' // TODO this should be using the same as /component/ /** * @internal */ export declare class Component { constructor(options?: any) // constructor information static cid: number static options: Record // extend static extend: GlobalAPI['extend'] static superOptions: Record static extendOptions: Record static sealedOptions: Record static super: typeof Component // assets static directive: GlobalAPI['directive'] static component: GlobalAPI['component'] static filter: GlobalAPI['filter'] // functional context constructor static FunctionalRenderContext: Function static mixin: GlobalAPI['mixin'] static use: GlobalAPI['use'] // public properties $el: any // so that we can attach __kdu__ to it $data: Record $props: Record $options: ComponentOptions $parent: Component | undefined $root: Component $children: Array $refs: { [key: string]: Component | Element | Array | undefined } $slots: { [key: string]: Array } $scopedSlots: { [key: string]: () => KNode[] | undefined } $knode: KNode // the placeholder node for the component in parent's render tree $attrs: { [key: string]: string } $listeners: Record> $isServer: boolean // public methods $mount: ( el?: Element | string, hydrating?: boolean ) => Component & { [key: string]: any } $forceUpdate: () => void $destroy: () => void $set: ( target: Record | Array, key: string | number, val: T ) => T $delete: ( target: Record | Array, key: string | number ) => void $watch: ( expOrFn: string | (() => any), cb: Function, options?: Record ) => Function $on: (event: string | Array, fn: Function) => Component $once: (event: string, fn: Function) => Component $off: (event?: string | Array, fn?: Function) => Component $emit: (event: string, ...args: Array) => Component $nextTick: (fn: (...args: any[]) => any) => void | Promise $createElement: ( tag?: string | Component, data?: Record, children?: KNodeChildren ) => KNode // private properties _uid: number | string _name: string // this only exists in dev mode _isKdu: true __k_skip: true _self: Component _renderProxy: Component _renderContext?: Component _watcher: Watcher | null _scope: EffectScope _computedWatchers: { [key: string]: Watcher } _data: Record _props: Record _events: Record _inactive: boolean | null _directInactive: boolean _isMounted: boolean _isDestroyed: boolean _isBeingDestroyed: boolean _knode?: KNode | null // self root node _staticTrees?: Array | null // k-once cached trees _hasHookEvent: boolean _provided: Record // _virtualComponents?: { [key: string]: Component }; // @v3 _setupState?: Record _setupProxy?: Record _setupContext?: SetupContext _attrsProxy?: Record _listenersProxy?: Record _slotsProxy?: Record KNode[]> _preWatchers?: Watcher[] // private methods // lifecycle _init: Function _mount: (el?: Element | void, hydrating?: boolean) => Component _update: (knode: KNode, hydrating?: boolean) => void // rendering _render: () => KNode __patch__: ( a: Element | KNode | void | null, b: KNode | null, hydrating?: boolean, removeOnly?: boolean, parentElm?: any, refElm?: any ) => any // createElement // _c is internal that accepts `normalizationType` optimization hint _c: ( knode?: KNode, data?: KNodeData, children?: KNodeChildren, normalizationType?: number ) => KNode | void // renderStatic _m: (index: number, isInFor?: boolean) => KNode | KNodeChildren // markOnce _o: ( knode: KNode | Array, index: number, key: string ) => KNode | KNodeChildren // toString _s: (value: any) => string // text to KNode _v: (value: string | number) => KNode // toNumber _n: (value: string) => number | string // empty knode _e: () => KNode // loose equal _q: (a: any, b: any) => boolean // loose indexOf _i: (arr: Array, val: any) => number // resolveFilter _f: (id: string) => Function // renderList _l: (val: any, render: Function) => Array | null // renderSlot _t: ( name: string, fallback?: Array, props?: Record ) => Array | null // apply k-bind object _b: ( data: any, tag: string, value: any, asProp: boolean, isSync?: boolean ) => KNodeData // apply k-on object _g: (data: any, value: any) => KNodeData // check custom keyCode _k: ( eventKeyCode: number, key: string, builtInAlias?: number | Array, eventKeyName?: string ) => boolean | null // resolve scoped slots _u: ( scopedSlots: ScopedSlotsData, res?: Record ) => { [key: string]: Function } // SSR specific _ssrNode: Function _ssrList: Function _ssrEscape: Function _ssrAttr: Function _ssrAttrs: Function _ssrDOMProps: Function _ssrClass: Function _ssrStyle: Function // allow dynamic method registration // [key: string]: any }