src/types/component.ts TYPESCRIPT 213 lines View on github.com → Search inside
1import type VNode from 'core/vdom/vnode'2import type Watcher from 'core/observer/watcher'3import { ComponentOptions } from './options'4import { SetupContext } from 'v3/apiSetup'5import { ScopedSlotsData, VNodeChildren, VNodeData } from './vnode'6import { GlobalAPI } from './global-api'7import { EffectScope } from 'v3/reactivity/effectScope'89// TODO this should be using the same as /component/1011/**12 * @internal13 */14export declare class Component {15  constructor(options?: any)16  // constructor information17  static cid: number18  static options: Record<string, any>19  // extend20  static extend: GlobalAPI['extend']21  static superOptions: Record<string, any>22  static extendOptions: Record<string, any>23  static sealedOptions: Record<string, any>24  static super: typeof Component25  // assets26  static directive: GlobalAPI['directive']27  static component: GlobalAPI['component']28  static filter: GlobalAPI['filter']29  // functional context constructor30  static FunctionalRenderContext: Function31  static mixin: GlobalAPI['mixin']32  static use: GlobalAPI['use']3334  // public properties35  $el: any // so that we can attach __vue__ to it36  $data: Record<string, any>37  $props: Record<string, any>38  $options: ComponentOptions39  $parent: Component | undefined40  $root: Component41  $children: Array<Component>42  $refs: {43    [key: string]: Component | Element | Array<Component | Element> | undefined44  }45  $slots: { [key: string]: Array<VNode> }46  $scopedSlots: { [key: string]: () => VNode[] | undefined }47  $vnode: VNode // the placeholder node for the component in parent's render tree48  $attrs: { [key: string]: string }49  $listeners: Record<string, Function | Array<Function>>50  $isServer: boolean5152  // public methods53  $mount: (54    el?: Element | string,55    hydrating?: boolean56  ) => Component & { [key: string]: any }57  $forceUpdate: () => void58  $destroy: () => void59  $set: <T>(60    target: Record<string, any> | Array<T>,61    key: string | number,62    val: T63  ) => T64  $delete: <T>(65    target: Record<string, any> | Array<T>,66    key: string | number67  ) => void68  $watch: (69    expOrFn: string | (() => any),70    cb: Function,71    options?: Record<string, any>72  ) => Function73  $on: (event: string | Array<string>, fn: Function) => Component74  $once: (event: string, fn: Function) => Component75  $off: (event?: string | Array<string>, fn?: Function) => Component76  $emit: (event: string, ...args: Array<any>) => Component77  $nextTick: (fn: (...args: any[]) => any) => void | Promise<any>78  $createElement: (79    tag?: string | Component,80    data?: Record<string, any>,81    children?: VNodeChildren82  ) => VNode8384  // private properties85  _uid: number | string86  _name: string // this only exists in dev mode87  _isVue: true88  __v_skip: true89  _self: Component90  _renderProxy: Component91  _renderContext?: Component92  _watcher: Watcher | null93  _scope: EffectScope94  _computedWatchers: { [key: string]: Watcher }95  _data: Record<string, any>96  _props: Record<string, any>97  _events: Record<string, any>98  _inactive: boolean | null99  _directInactive: boolean100  _isMounted: boolean101  _isDestroyed: boolean102  _isBeingDestroyed: boolean103  _vnode?: VNode | null // self root node104  _staticTrees?: Array<VNode> | null // v-once cached trees105  _hasHookEvent: boolean106  _provided: Record<string, any>107  // _virtualComponents?: { [key: string]: Component };108109  // @v3110  _setupState?: Record<string, any>111  _setupProxy?: Record<string, any>112  _setupContext?: SetupContext113  _attrsProxy?: Record<string, any>114  _listenersProxy?: Record<string, Function | Function[]>115  _slotsProxy?: Record<string, () => VNode[]>116  _preWatchers?: Watcher[]117118  // private methods119120  // lifecycle121  _init: Function122  _mount: (el?: Element | void, hydrating?: boolean) => Component123  _update: (vnode: VNode, hydrating?: boolean) => void124125  // rendering126  _render: () => VNode127128  __patch__: (129    a: Element | VNode | void | null,130    b: VNode | null,131    hydrating?: boolean,132    removeOnly?: boolean,133    parentElm?: any,134    refElm?: any135  ) => any136137  // createElement138139  // _c is internal that accepts `normalizationType` optimization hint140  _c: (141    vnode?: VNode,142    data?: VNodeData,143    children?: VNodeChildren,144    normalizationType?: number145  ) => VNode | void146147  // renderStatic148  _m: (index: number, isInFor?: boolean) => VNode | VNodeChildren149  // markOnce150  _o: (151    vnode: VNode | Array<VNode>,152    index: number,153    key: string154  ) => VNode | VNodeChildren155  // toString156  _s: (value: any) => string157  // text to VNode158  _v: (value: string | number) => VNode159  // toNumber160  _n: (value: string) => number | string161  // empty vnode162  _e: () => VNode163  // loose equal164  _q: (a: any, b: any) => boolean165  // loose indexOf166  _i: (arr: Array<any>, val: any) => number167  // resolveFilter168  _f: (id: string) => Function169  // renderList170  _l: (val: any, render: Function) => Array<VNode> | null171  // renderSlot172  _t: (173    name: string,174    fallback?: Array<VNode>,175    props?: Record<string, any>176  ) => Array<VNode> | null177  // apply v-bind object178  _b: (179    data: any,180    tag: string,181    value: any,182    asProp: boolean,183    isSync?: boolean184  ) => VNodeData185  // apply v-on object186  _g: (data: any, value: any) => VNodeData187  // check custom keyCode188  _k: (189    eventKeyCode: number,190    key: string,191    builtInAlias?: number | Array<number>,192    eventKeyName?: string193  ) => boolean | null194  // resolve scoped slots195  _u: (196    scopedSlots: ScopedSlotsData,197    res?: Record<string, any>198  ) => { [key: string]: Function }199200  // SSR specific201  _ssrNode: Function202  _ssrList: Function203  _ssrEscape: Function204  _ssrAttr: Function205  _ssrAttrs: Function206  _ssrDOMProps: Function207  _ssrClass: Function208  _ssrStyle: Function209210  // allow dynamic method registration211  // [key: string]: any212}

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.