shared.d.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /**
  2. * List of @babel/parser plugins that are used for template expression
  3. * transforms and SFC script transforms. By default we enable proposals slated
  4. * for ES2020. This will need to be updated as the spec moves forward.
  5. * Full list at https://babeljs.io/docs/en/next/babel-parser#plugins
  6. */
  7. export declare const babelParserDefaultPlugins: readonly ["bigInt", "optionalChaining", "nullishCoalescingOperator"];
  8. /**
  9. * @private
  10. */
  11. export declare const camelize: (str: string) => string;
  12. /**
  13. * @private
  14. */
  15. export declare const capitalize: (str: string) => string;
  16. export declare const def: (obj: object, key: string | symbol, value: any) => void;
  17. export declare const EMPTY_ARR: readonly never[];
  18. export declare const EMPTY_OBJ: {
  19. readonly [key: string]: any;
  20. };
  21. export declare function escapeHtml(string: unknown): string;
  22. export declare function escapeHtmlComment(src: string): string;
  23. export declare const extend: {
  24. <T, U>(target: T, source: U): T & U;
  25. <T_1, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
  26. <T_2, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
  27. (target: object, ...sources: any[]): any;
  28. };
  29. export declare function generateCodeFrame(source: string, start?: number, end?: number): string;
  30. export declare const getGlobalThis: () => any;
  31. export declare const hasChanged: (value: any, oldValue: any) => boolean;
  32. export declare const hasOwn: (val: object, key: string | symbol) => key is never;
  33. /**
  34. * @private
  35. */
  36. export declare const hyphenate: (str: string) => string;
  37. export declare const invokeArrayFns: (fns: Function[], arg?: any) => void;
  38. export declare const isArray: (arg: any) => arg is any[];
  39. /**
  40. * The full list is needed during SSR to produce the correct initial markup.
  41. */
  42. export declare const isBooleanAttr: (key: string) => boolean;
  43. export declare const isDate: (val: unknown) => val is Date;
  44. export declare const isFunction: (val: unknown) => val is Function;
  45. export declare const isGloballyWhitelisted: (key: string) => boolean;
  46. export declare const isHTMLTag: (key: string) => boolean;
  47. export declare const isIntegerKey: (key: unknown) => boolean;
  48. /**
  49. * Known attributes, this is used for stringification of runtime static nodes
  50. * so that we don't stringify bindings that cannot be set from HTML.
  51. * Don't also forget to allow `data-*` and `aria-*`!
  52. * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
  53. */
  54. export declare const isKnownAttr: (key: string) => boolean;
  55. export declare const isMap: (val: unknown) => val is Map<any, any>;
  56. export declare const isModelListener: (key: string) => boolean;
  57. /**
  58. * CSS properties that accept plain numbers
  59. */
  60. export declare const isNoUnitNumericStyleProp: (key: string) => boolean;
  61. export declare const isObject: (val: unknown) => val is Record<any, any>;
  62. export declare const isOn: (key: string) => boolean;
  63. export declare const isPlainObject: (val: unknown) => val is object;
  64. export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
  65. export declare const isReservedProp: (key: string) => boolean;
  66. export declare const isSet: (val: unknown) => val is Set<any>;
  67. export declare const isSpecialBooleanAttr: (key: string) => boolean;
  68. export declare function isSSRSafeAttrName(name: string): boolean;
  69. export declare const isString: (val: unknown) => val is string;
  70. export declare const isSVGTag: (key: string) => boolean;
  71. export declare const isSymbol: (val: unknown) => val is symbol;
  72. export declare const isVoidTag: (key: string) => boolean;
  73. export declare function looseEqual(a: any, b: any): boolean;
  74. export declare function looseIndexOf(arr: any[], val: any): number;
  75. /**
  76. * Make a map and return a function for checking if a key
  77. * is in that map.
  78. * IMPORTANT: all calls of this function must be prefixed with
  79. * \/\*#\_\_PURE\_\_\*\/
  80. * So that rollup can tree-shake them if necessary.
  81. */
  82. export declare function makeMap(str: string, expectsLowerCase?: boolean): (key: string) => boolean;
  83. /**
  84. * Always return false.
  85. */
  86. export declare const NO: () => boolean;
  87. export declare const NOOP: () => void;
  88. export declare function normalizeClass(value: unknown): string;
  89. export declare type NormalizedStyle = Record<string, string | number>;
  90. export declare function normalizeStyle(value: unknown): NormalizedStyle | undefined;
  91. export declare const objectToString: () => string;
  92. export declare function parseStringStyle(cssText: string): NormalizedStyle;
  93. export declare const PatchFlagNames: {
  94. [x: number]: string;
  95. };
  96. export declare const enum PatchFlags {
  97. TEXT = 1,
  98. CLASS = 2,
  99. STYLE = 4,
  100. PROPS = 8,
  101. FULL_PROPS = 16,
  102. HYDRATE_EVENTS = 32,
  103. STABLE_FRAGMENT = 64,
  104. KEYED_FRAGMENT = 128,
  105. UNKEYED_FRAGMENT = 256,
  106. NEED_PATCH = 512,
  107. DYNAMIC_SLOTS = 1024,
  108. HOISTED = -1,
  109. BAIL = -2
  110. }
  111. export declare const propsToAttrMap: Record<string, string | undefined>;
  112. export declare const remove: <T>(arr: T[], el: T) => void;
  113. export declare const enum ShapeFlags {
  114. ELEMENT = 1,
  115. FUNCTIONAL_COMPONENT = 2,
  116. STATEFUL_COMPONENT = 4,
  117. TEXT_CHILDREN = 8,
  118. ARRAY_CHILDREN = 16,
  119. SLOTS_CHILDREN = 32,
  120. TELEPORT = 64,
  121. SUSPENSE = 128,
  122. COMPONENT_SHOULD_KEEP_ALIVE = 256,
  123. COMPONENT_KEPT_ALIVE = 512,
  124. COMPONENT = 6
  125. }
  126. export declare const enum SlotFlags {
  127. /**
  128. * Stable slots that only reference slot props or context state. The slot
  129. * can fully capture its own dependencies so when passed down the parent won't
  130. * need to force the child to update.
  131. */
  132. STABLE = 1,
  133. /**
  134. * Slots that reference scope variables (v-for or an outer slot prop), or
  135. * has conditional structure (v-if, v-for). The parent will need to force
  136. * the child to update because the slot does not fully capture its dependencies.
  137. */
  138. DYNAMIC = 2,
  139. /**
  140. * `<slot/>` being forwarded into a child component. Whether the parent needs
  141. * to update the child is dependent on what kind of slots the parent itself
  142. * received. This has to be refined at runtime, when the child's vnode
  143. * is being created (in `normalizeChildren`)
  144. */
  145. FORWARDED = 3
  146. }
  147. export declare function stringifyStyle(styles: NormalizedStyle | undefined): string;
  148. /**
  149. * For converting {{ interpolation }} values to displayed strings.
  150. * @private
  151. */
  152. export declare const toDisplayString: (val: unknown) => string;
  153. /**
  154. * @private
  155. */
  156. export declare const toHandlerKey: (str: string) => string;
  157. export declare const toNumber: (val: any) => any;
  158. export declare const toRawType: (value: unknown) => string;
  159. export declare const toTypeString: (value: unknown) => string;
  160. export { }