vue 2.7.8 → 2.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,245 @@
1
+ import { rewriteDefault } from '../src'
2
+
3
+ describe('compiler sfc: rewriteDefault', () => {
4
+ test('without export default', () => {
5
+ expect(rewriteDefault(`export a = {}`, 'script')).toMatchInlineSnapshot(`
6
+ "export a = {}
7
+ const script = {}"
8
+ `)
9
+ })
10
+
11
+ test('rewrite export default', () => {
12
+ expect(
13
+ rewriteDefault(`export default {}`, 'script')
14
+ ).toMatchInlineSnapshot(`"const script = {}"`)
15
+ })
16
+
17
+ test('rewrite export named default', () => {
18
+ expect(
19
+ rewriteDefault(
20
+ `const a = 1 \n export { a as b, a as default, a as c}`,
21
+ 'script'
22
+ )
23
+ ).toMatchInlineSnapshot(`
24
+ "const a = 1
25
+ export { a as b, a as c}
26
+ const script = a"
27
+ `)
28
+
29
+ expect(
30
+ rewriteDefault(
31
+ `const a = 1 \n export { a as b, a as default , a as c}`,
32
+ 'script'
33
+ )
34
+ ).toMatchInlineSnapshot(`
35
+ "const a = 1
36
+ export { a as b, a as c}
37
+ const script = a"
38
+ `)
39
+ })
40
+
41
+ test('w/ comments', async () => {
42
+ expect(rewriteDefault(`// export default\nexport default {}`, 'script'))
43
+ .toMatchInlineSnapshot(`
44
+ "// export default
45
+ const script = {}"
46
+ `)
47
+ })
48
+
49
+ test('export named default multiline', () => {
50
+ expect(
51
+ rewriteDefault(`let App = {}\n export {\nApp as default\n}`, '_sfc_main')
52
+ ).toMatchInlineSnapshot(`
53
+ "let App = {}
54
+ export {
55
+
56
+ }
57
+ const _sfc_main = App"
58
+ `)
59
+ })
60
+
61
+ test('export named default multiline /w comments', () => {
62
+ expect(
63
+ rewriteDefault(
64
+ `const a = 1 \n export {\n a as b,\n a as default,\n a as c}\n` +
65
+ `// export { myFunction as default }`,
66
+ 'script'
67
+ )
68
+ ).toMatchInlineSnapshot(`
69
+ "const a = 1
70
+ export {
71
+ a as b,
72
+
73
+ a as c}
74
+ // export { myFunction as default }
75
+ const script = a"
76
+ `)
77
+
78
+ expect(
79
+ rewriteDefault(
80
+ `const a = 1 \n export {\n a as b,\n a as default ,\n a as c}\n` +
81
+ `// export { myFunction as default }`,
82
+ 'script'
83
+ )
84
+ ).toMatchInlineSnapshot(`
85
+ "const a = 1
86
+ export {
87
+ a as b,
88
+
89
+ a as c}
90
+ // export { myFunction as default }
91
+ const script = a"
92
+ `)
93
+ })
94
+
95
+ test(`export { default } from '...'`, async () => {
96
+ expect(
97
+ rewriteDefault(`export { default, foo } from './index.js'`, 'script')
98
+ ).toMatchInlineSnapshot(`
99
+ "import { default as __VUE_DEFAULT__ } from './index.js'
100
+ export { foo } from './index.js'
101
+ const script = __VUE_DEFAULT__"
102
+ `)
103
+
104
+ expect(
105
+ rewriteDefault(`export { default , foo } from './index.js'`, 'script')
106
+ ).toMatchInlineSnapshot(`
107
+ "import { default as __VUE_DEFAULT__ } from './index.js'
108
+ export { foo } from './index.js'
109
+ const script = __VUE_DEFAULT__"
110
+ `)
111
+
112
+ expect(
113
+ rewriteDefault(`export { foo, default } from './index.js'`, 'script')
114
+ ).toMatchInlineSnapshot(`
115
+ "import { default as __VUE_DEFAULT__ } from './index.js'
116
+ export { foo, } from './index.js'
117
+ const script = __VUE_DEFAULT__"
118
+ `)
119
+
120
+ expect(
121
+ rewriteDefault(
122
+ `export { foo as default, bar } from './index.js'`,
123
+ 'script'
124
+ )
125
+ ).toMatchInlineSnapshot(`
126
+ "import { foo } from './index.js'
127
+ export { bar } from './index.js'
128
+ const script = foo"
129
+ `)
130
+
131
+ expect(
132
+ rewriteDefault(
133
+ `export { foo as default , bar } from './index.js'`,
134
+ 'script'
135
+ )
136
+ ).toMatchInlineSnapshot(`
137
+ "import { foo } from './index.js'
138
+ export { bar } from './index.js'
139
+ const script = foo"
140
+ `)
141
+
142
+ expect(
143
+ rewriteDefault(
144
+ `export { bar, foo as default } from './index.js'`,
145
+ 'script'
146
+ )
147
+ ).toMatchInlineSnapshot(`
148
+ "import { foo } from './index.js'
149
+ export { bar, } from './index.js'
150
+ const script = foo"
151
+ `)
152
+ })
153
+
154
+ test('export default class', async () => {
155
+ expect(rewriteDefault(`export default class Foo {}`, 'script'))
156
+ .toMatchInlineSnapshot(`
157
+ "class Foo {}
158
+ const script = Foo"
159
+ `)
160
+ })
161
+
162
+ test('export default class w/ comments', async () => {
163
+ expect(
164
+ rewriteDefault(`// export default\nexport default class Foo {}`, 'script')
165
+ ).toMatchInlineSnapshot(`
166
+ "// export default
167
+ class Foo {}
168
+ const script = Foo"
169
+ `)
170
+ })
171
+
172
+ test('export default class w/ comments 2', async () => {
173
+ expect(
174
+ rewriteDefault(
175
+ `export default {}\n` + `// export default class Foo {}`,
176
+ 'script'
177
+ )
178
+ ).toMatchInlineSnapshot(`
179
+ "const script = {}
180
+ // export default class Foo {}"
181
+ `)
182
+ })
183
+
184
+ test('export default class w/ comments 3', async () => {
185
+ expect(
186
+ rewriteDefault(
187
+ `/*\nexport default class Foo {}*/\n` + `export default class Bar {}`,
188
+ 'script'
189
+ )
190
+ ).toMatchInlineSnapshot(`
191
+ "/*
192
+ export default class Foo {}*/
193
+ class Bar {}
194
+ const script = Bar"
195
+ `)
196
+ })
197
+
198
+ test('@Component\nexport default class', async () => {
199
+ expect(rewriteDefault(`@Component\nexport default class Foo {}`, 'script'))
200
+ .toMatchInlineSnapshot(`
201
+ "@Component
202
+ class Foo {}
203
+ const script = Foo"
204
+ `)
205
+ })
206
+
207
+ test('@Component\nexport default class w/ comments', async () => {
208
+ expect(
209
+ rewriteDefault(`// export default\n@Component\nexport default class Foo {}`, 'script')
210
+ ).toMatchInlineSnapshot(`
211
+ "// export default
212
+ @Component
213
+ class Foo {}
214
+ const script = Foo"
215
+ `)
216
+ })
217
+
218
+ test('@Component\nexport default class w/ comments 2', async () => {
219
+ expect(
220
+ rewriteDefault(
221
+ `export default {}\n` + `// @Component\n// export default class Foo {}`,
222
+ 'script'
223
+ )
224
+ ).toMatchInlineSnapshot(`
225
+ "const script = {}
226
+ // @Component
227
+ // export default class Foo {}"
228
+ `)
229
+ })
230
+
231
+ test('@Component\nexport default class w/ comments 3', async () => {
232
+ expect(
233
+ rewriteDefault(
234
+ `/*\n@Component\nexport default class Foo {}*/\n` + `export default class Bar {}`,
235
+ 'script'
236
+ )
237
+ ).toMatchInlineSnapshot(`
238
+ "/*
239
+ @Component
240
+ export default class Foo {}*/
241
+ class Bar {}
242
+ const script = Bar"
243
+ `)
244
+ })
245
+ })
@@ -34,6 +34,7 @@ export function initMixin(Vue: typeof Component) {
34
34
  vm.__v_skip = true
35
35
  // effect scope
36
36
  vm._scope = new EffectScope(true /* detached */)
37
+ vm._scope._vm = true
37
38
  // merge options
38
39
  if (options && options._isComponent) {
39
40
  // optimize internal component instantiation
@@ -19,7 +19,7 @@ if (__DEV__) {
19
19
  'referenced during render. Make sure that this property is reactive, ' +
20
20
  'either in the data option, or for class-based components, by ' +
21
21
  'initializing the property. ' +
22
- 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
22
+ 'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
23
23
  target
24
24
  )
25
25
  }
@@ -29,7 +29,7 @@ if (__DEV__) {
29
29
  `Property "${key}" must be accessed with "$data.${key}" because ` +
30
30
  'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
31
31
  'prevent conflicts with Vue internals. ' +
32
- 'See: https://vuejs.org/v2/api/#data',
32
+ 'See: https://v2.vuejs.org/v2/api/#data',
33
33
  target
34
34
  )
35
35
  }
@@ -127,7 +127,7 @@ function initData(vm: Component) {
127
127
  __DEV__ &&
128
128
  warn(
129
129
  'data functions should return an object:\n' +
130
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
130
+ 'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
131
131
  vm
132
132
  )
133
133
  }
@@ -71,11 +71,18 @@ export default class Watcher implements DepTarget {
71
71
  options?: WatcherOptions | null,
72
72
  isRenderWatcher?: boolean
73
73
  ) {
74
- recordEffectScope(this, activeEffectScope || (vm ? vm._scope : undefined))
75
- if ((this.vm = vm)) {
76
- if (isRenderWatcher) {
77
- vm._watcher = this
78
- }
74
+ recordEffectScope(
75
+ this,
76
+ // if the active effect scope is manually created (not a component scope),
77
+ // prioritize it
78
+ activeEffectScope && !activeEffectScope._vm
79
+ ? activeEffectScope
80
+ : vm
81
+ ? vm._scope
82
+ : undefined
83
+ )
84
+ if ((this.vm = vm) && isRenderWatcher) {
85
+ vm._watcher = this
79
86
  }
80
87
  // options
81
88
  if (options) {
@@ -103,7 +103,15 @@ function normalizeDirectives(
103
103
  }
104
104
  res[getRawDirName(dir)] = dir
105
105
  if (vm._setupState && vm._setupState.__sfc) {
106
- dir.def = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name)
106
+ const setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name)
107
+ if (typeof setupDef === 'function') {
108
+ dir.def = {
109
+ bind: setupDef,
110
+ update: setupDef,
111
+ }
112
+ } else {
113
+ dir.def = setupDef
114
+ }
107
115
  }
108
116
  dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true)
109
117
  }
@@ -33,6 +33,7 @@ export default class VNode {
33
33
  fnOptions?: ComponentOptions | null // for SSR caching
34
34
  devtoolsMeta?: Object | null // used to store functional render context for devtools
35
35
  fnScopeId?: string | null // functional scope id support
36
+ isComponentRootElement?: boolean | null // for SSR directives
36
37
 
37
38
  constructor(
38
39
  tag?: string,
@@ -42,7 +42,6 @@ export const onBeforeUpdate = createLifeCycle('beforeUpdate')
42
42
  export const onUpdated = createLifeCycle('updated')
43
43
  export const onBeforeUnmount = createLifeCycle('beforeDestroy')
44
44
  export const onUnmounted = createLifeCycle('destroyed')
45
- export const onErrorCaptured = createLifeCycle('errorCaptured')
46
45
  export const onActivated = createLifeCycle('activated')
47
46
  export const onDeactivated = createLifeCycle('deactivated')
48
47
  export const onServerPrefetch = createLifeCycle('serverPrefetch')
@@ -51,3 +50,19 @@ export const onRenderTracked =
51
50
  createLifeCycle<(e: DebuggerEvent) => any>('renderTracked')
52
51
  export const onRenderTriggered =
53
52
  createLifeCycle<(e: DebuggerEvent) => any>('renderTriggered')
53
+
54
+ export type ErrorCapturedHook<TError = unknown> = (
55
+ err: TError,
56
+ instance: any,
57
+ info: string
58
+ ) => boolean | void
59
+
60
+ const injectErrorCapturedHook =
61
+ createLifeCycle<ErrorCapturedHook<any>>('errorCaptured')
62
+
63
+ export function onErrorCaptured<TError = Error>(
64
+ hook: ErrorCapturedHook<TError>,
65
+ target: any = currentInstance
66
+ ) {
67
+ injectErrorCapturedHook(hook, target)
68
+ }
@@ -274,10 +274,7 @@ function doWatch(
274
274
  let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE
275
275
  // overwrite default run
276
276
  watcher.run = () => {
277
- if (
278
- !watcher.active &&
279
- !(flush === 'pre' && instance && instance._isBeingDestroyed)
280
- ) {
277
+ if (!watcher.active) {
281
278
  return
282
279
  }
283
280
  if (cb) {
@@ -27,10 +27,14 @@ export class EffectScope {
27
27
  * @internal
28
28
  */
29
29
  scopes: EffectScope[] | undefined
30
+ /**
31
+ * indicates this being a component root scope
32
+ * @internal
33
+ */
34
+ _vm?: boolean
30
35
  /**
31
36
  * track a child scope's index in its parent's scopes array for optimized
32
37
  * removal
33
- * @internal
34
38
  */
35
39
  private index: number | undefined
36
40
 
package/types/index.d.ts CHANGED
@@ -41,7 +41,7 @@ export * from './v3-setup-helpers'
41
41
 
42
42
  export { Data } from './common'
43
43
  export { SetupContext } from './v3-setup-context'
44
- export { defineComponent } from './v3-define-component'
44
+ export { defineComponent, DefineComponent } from './v3-define-component'
45
45
  export { defineAsyncComponent } from './v3-define-async-component'
46
46
  export {
47
47
  SetupFunction,
@@ -3,6 +3,7 @@ import { VNode, VNodeData, VNodeDirective, NormalizedScopedSlot } from './vnode'
3
3
  import { SetupContext } from './v3-setup-context'
4
4
  import { DebuggerEvent } from './v3-generated'
5
5
  import { DefineComponent } from './v3-define-component'
6
+ import { ComponentOptionsMixin } from './v3-component-options'
6
7
 
7
8
  type Constructor = {
8
9
  new (...args: any[]): any
@@ -93,7 +94,9 @@ export type ThisTypedComponentOptionsWithArrayProps<
93
94
  Methods,
94
95
  Computed,
95
96
  PropNames extends string,
96
- SetupBindings
97
+ SetupBindings,
98
+ Mixin,
99
+ Extends
97
100
  > = object &
98
101
  ComponentOptions<
99
102
  V,
@@ -102,7 +105,9 @@ export type ThisTypedComponentOptionsWithArrayProps<
102
105
  Computed,
103
106
  PropNames[],
104
107
  Record<PropNames, any>,
105
- SetupBindings
108
+ SetupBindings,
109
+ Mixin,
110
+ Extends
106
111
  > &
107
112
  ThisType<
108
113
  CombinedVueInstance<
@@ -111,7 +116,9 @@ export type ThisTypedComponentOptionsWithArrayProps<
111
116
  Methods,
112
117
  Computed,
113
118
  Readonly<Record<PropNames, any>>,
114
- SetupBindings
119
+ SetupBindings,
120
+ Mixin,
121
+ Extends
115
122
  >
116
123
  >
117
124
 
@@ -124,7 +131,9 @@ export type ThisTypedComponentOptionsWithRecordProps<
124
131
  Methods,
125
132
  Computed,
126
133
  Props,
127
- SetupBindings
134
+ SetupBindings,
135
+ Mixin,
136
+ Extends
128
137
  > = object &
129
138
  ComponentOptions<
130
139
  V,
@@ -133,7 +142,9 @@ export type ThisTypedComponentOptionsWithRecordProps<
133
142
  Computed,
134
143
  RecordPropsDefinition<Props>,
135
144
  Props,
136
- SetupBindings
145
+ SetupBindings,
146
+ Mixin,
147
+ Extends
137
148
  > &
138
149
  ThisType<
139
150
  CombinedVueInstance<
@@ -142,7 +153,9 @@ export type ThisTypedComponentOptionsWithRecordProps<
142
153
  Methods,
143
154
  Computed,
144
155
  Readonly<Props>,
145
- SetupBindings
156
+ SetupBindings,
157
+ Mixin,
158
+ Extends
146
159
  >
147
160
  >
148
161
 
@@ -158,7 +171,9 @@ export interface ComponentOptions<
158
171
  Computed = DefaultComputed,
159
172
  PropsDef = PropsDefinition<DefaultProps>,
160
173
  Props = DefaultProps,
161
- RawBindings = {}
174
+ RawBindings = {},
175
+ Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
176
+ Extends extends ComponentOptionsMixin = ComponentOptionsMixin
162
177
  > {
163
178
  data?: Data
164
179
  props?: PropsDef
@@ -217,12 +232,12 @@ export interface ComponentOptions<
217
232
  }
218
233
 
219
234
  parent?: Vue
220
- mixins?: (ComponentOptions<Vue> | typeof Vue)[]
235
+ mixins?: (Mixin | ComponentOptions<Vue> | typeof Vue)[]
221
236
  name?: string
222
237
  // for SFC auto name inference w/ ts-loader check
223
238
  __name?: string
224
239
  // TODO: support properly inferred 'extends'
225
- extends?: ComponentOptions<Vue> | typeof Vue
240
+ extends?: Extends | ComponentOptions<Vue> | typeof Vue
226
241
  delimiters?: [string, string]
227
242
  comments?: boolean
228
243
  inheritAttrs?: boolean
@@ -88,6 +88,9 @@ export interface ComponentOptionsBase<
88
88
  'data' | 'computed' | 'methods' | 'setup' | 'props' | 'mixins' | 'extends'
89
89
  >,
90
90
  ComponentCustomOptions {
91
+ // allow any options
92
+ [key: string]: any
93
+
91
94
  // rewrite options api types
92
95
  data?: (
93
96
  this: CreateComponentPublicInstance<Props, {}, {}, {}, M, Mixin, Extends>,
@@ -79,11 +79,11 @@ type ExtractMixin<T> = {
79
79
  Mixin: MixinToOptionTypes<T>
80
80
  }[T extends ComponentOptionsMixin ? 'Mixin' : never]
81
81
 
82
- type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true
82
+ export type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true
83
83
  ? OptionTypesType<{}, {}, {}, {}, {}, {}>
84
84
  : UnionToIntersection<ExtractMixin<T>>
85
85
 
86
- type UnwrapMixinsType<
86
+ export type UnwrapMixinsType<
87
87
  T,
88
88
  Type extends OptionTypesKeys
89
89
  > = T extends OptionTypesType ? T[Type] : never
@@ -20,7 +20,7 @@ import { Data, HasDefined } from './common'
20
20
  import { EmitsOptions } from './v3-setup-context'
21
21
  import { CreateElement, RenderContext } from './umd'
22
22
 
23
- type DefineComponent<
23
+ export type DefineComponent<
24
24
  PropsOrPropOptions = {},
25
25
  RawBindings = {},
26
26
  D = {},
@@ -67,36 +67,12 @@ type DefineComponent<
67
67
  props: PropsOrPropOptions
68
68
  }
69
69
 
70
- /**
71
- * overload 0.0: functional component with array props
72
- */
73
- export function defineComponent<
74
- PropNames extends string,
75
- Props = Readonly<{ [key in PropNames]?: any }>
76
- >(options: {
77
- functional: true
78
- props?: PropNames[]
79
- render?: (h: CreateElement, context: RenderContext<Props>) => any
80
- }): DefineComponent<Props>
81
-
82
- /**
83
- * overload 0.1: functional component with object props
84
- */
85
- export function defineComponent<
86
- PropsOptions extends ComponentPropsOptions = ComponentPropsOptions,
87
- Props = ExtractPropTypes<PropsOptions>
88
- >(options: {
89
- functional: true
90
- props?: PropsOptions
91
- render?: (h: CreateElement, context: RenderContext<Props>) => any
92
- }): DefineComponent<PropsOptions>
93
-
94
70
  /**
95
71
  * overload 1: object format with no props
96
72
  */
97
73
  export function defineComponent<
98
74
  RawBindings,
99
- D = Data,
75
+ D = {},
100
76
  C extends ComputedOptions = {},
101
77
  M extends MethodOptions = {},
102
78
  Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
@@ -104,7 +80,7 @@ export function defineComponent<
104
80
  Emits extends EmitsOptions = {},
105
81
  EmitsNames extends string = string
106
82
  >(
107
- options: ComponentOptionsWithoutProps<
83
+ options: { functional?: never } & ComponentOptionsWithoutProps<
108
84
  {},
109
85
  RawBindings,
110
86
  D,
@@ -125,8 +101,8 @@ export function defineComponent<
125
101
  */
126
102
  export function defineComponent<
127
103
  PropNames extends string,
128
- RawBindings = Data,
129
- D = Data,
104
+ RawBindings = {},
105
+ D = {},
130
106
  C extends ComputedOptions = {},
131
107
  M extends MethodOptions = {},
132
108
  Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
@@ -135,7 +111,7 @@ export function defineComponent<
135
111
  EmitsNames extends string = string,
136
112
  PropsOptions extends ComponentPropsOptions = ComponentPropsOptions
137
113
  >(
138
- options: ComponentOptionsWithArrayProps<
114
+ options: { functional?: never } & ComponentOptionsWithArrayProps<
139
115
  PropNames,
140
116
  RawBindings,
141
117
  D,
@@ -164,8 +140,8 @@ export function defineComponent<
164
140
  */
165
141
  export function defineComponent<
166
142
  Props,
167
- RawBindings = Data,
168
- D = Data,
143
+ RawBindings = {},
144
+ D = {},
169
145
  C extends ComputedOptions = {},
170
146
  M extends MethodOptions = {},
171
147
  Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
@@ -175,7 +151,7 @@ export function defineComponent<
175
151
  PropsOptions extends ComponentPropsOptions = ComponentPropsOptions
176
152
  >(
177
153
  options: HasDefined<Props> extends true
178
- ? ComponentOptionsWithProps<
154
+ ? { functional?: never } & ComponentOptionsWithProps<
179
155
  PropsOptions,
180
156
  RawBindings,
181
157
  D,
@@ -187,7 +163,7 @@ export function defineComponent<
187
163
  EmitsNames,
188
164
  Props
189
165
  >
190
- : ComponentOptionsWithProps<
166
+ : { functional?: never } & ComponentOptionsWithProps<
191
167
  PropsOptions,
192
168
  RawBindings,
193
169
  D,
@@ -199,3 +175,27 @@ export function defineComponent<
199
175
  EmitsNames
200
176
  >
201
177
  ): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits>
178
+
179
+ /**
180
+ * overload 4.1: functional component with array props
181
+ */
182
+ export function defineComponent<
183
+ PropNames extends string,
184
+ Props = Readonly<{ [key in PropNames]?: any }>
185
+ >(options: {
186
+ functional: true
187
+ props?: PropNames[]
188
+ render?: (h: CreateElement, context: RenderContext<Props>) => any
189
+ }): DefineComponent<Props>
190
+
191
+ /**
192
+ * overload 4.2: functional component with object props
193
+ */
194
+ export function defineComponent<
195
+ PropsOptions extends ComponentPropsOptions = ComponentPropsOptions,
196
+ Props = ExtractPropTypes<PropsOptions>
197
+ >(options: {
198
+ functional: true
199
+ props?: PropsOptions
200
+ render?: (h: CreateElement, context: RenderContext<Props>) => any
201
+ }): DefineComponent<PropsOptions>
@@ -96,7 +96,12 @@ export declare class EffectScope {
96
96
  /* Excluded from this release type: cleanups */
97
97
  /* Excluded from this release type: parent */
98
98
  /* Excluded from this release type: scopes */
99
- /* Excluded from this release type: index */
99
+ /* Excluded from this release type: _vm */
100
+ /**
101
+ * track a child scope's index in its parent's scopes array for optimized
102
+ * removal
103
+ */
104
+ private index;
100
105
  constructor(detached?: boolean);
101
106
  run<T>(fn: () => T): T | undefined;
102
107
  /* Excluded from this release type: on */
@@ -106,6 +111,8 @@ export declare class EffectScope {
106
111
 
107
112
  export declare function effectScope(detached?: boolean): EffectScope;
108
113
 
114
+ export declare type ErrorCapturedHook<TError = unknown> = (err: TError, instance: any, info: string) => boolean | void;
115
+
109
116
  /* Excluded from this release type: getCurrentInstance */
110
117
 
111
118
  export declare function getCurrentScope(): EffectScope | undefined;
@@ -169,7 +176,7 @@ declare type OnCleanup = (cleanupFn: () => void) => void;
169
176
 
170
177
  export declare const onDeactivated: (fn: () => void, target?: any) => void;
171
178
 
172
- export declare const onErrorCaptured: (fn: () => void, target?: any) => void;
179
+ export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: any): void;
173
180
 
174
181
  export declare const onMounted: (fn: () => void, target?: any) => void;
175
182