Przeglądaj źródła

cover Symbol for provide/inject typing

Evan You 9 lat temu
rodzic
commit
3b7b597044
2 zmienionych plików z 3 dodań i 3 usunięć
  1. 2 2
      flow/options.js
  2. 1 1
      types/options.d.ts

+ 2 - 2
flow/options.js

@@ -53,8 +53,8 @@ declare type ComponentOptions = {
   filters?: { [key: string]: Function };
 
   // context
-  provide?: Object | () => Object;
-  inject?: { [key: string]: string } | Array<string>;
+  provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
+  inject?: { [key: string]: string | Symbol } | Array<string>;
 
   // component v-model customization
   model?: {

+ 1 - 1
types/options.d.ts

@@ -42,7 +42,7 @@ export interface ComponentOptions<V extends Vue> {
   filters?: { [key: string]: Function };
 
   provide?: Object | (() => Object);
-  inject?: { [key: string]: string } | Array<string>;
+  inject?: { [key: string]: string | symbol } | Array<string>;
 
   model?: {
     prop?: string;