Skip to content

Commit

Permalink
Made it so that any 'data' function can only access 'props' and base …
Browse files Browse the repository at this point in the history
…Vue instance members.
  • Loading branch information
DanielRosenwasser committed Mar 27, 2017
1 parent 8cd5b9c commit 540a38f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type Accessors<T> = {
*/
export type ThisTypedComponentOptions<Data, Methods, Computed, PropNames extends string = never, Instance extends AnyVue = Vue<Data, Methods, Computed, Record<PropNames, any>>> =
object &
ComponentOptions<Data, Methods, Computed, PropNames[] | Record<PropNames, PropOptions>> &
ComponentOptions<Data | ((this: Record<PropNames, any> & AnyVue) => Data), Methods, Computed, PropNames[] | Record<PropNames, PropOptions>> &
ThisType<Data & Methods & Computed & Record<PropNames, any> & Instance>;

/**
Expand All @@ -49,7 +49,7 @@ export type ThisTypedComponentOptions<Data, Methods, Computed, PropNames extends
*/
export type ThisTypedComponentOptionsWithArrayProps<Data, Methods, Computed, PropNames extends string, Instance extends AnyVue = Vue<Data, Methods, Computed, PropNames>> =
object &
ComponentOptions<Data, Methods, Computed, PropNames[]> &
ComponentOptions<Data | ((this: Record<PropNames, any> & AnyVue) => Data), Methods, Computed, PropNames[]> &
ThisType<Data & Methods & Computed & Record<PropNames, any> & Instance>;

/**
Expand All @@ -58,7 +58,7 @@ export type ThisTypedComponentOptionsWithArrayProps<Data, Methods, Computed, Pro
*/
export type ThisTypedComponentOptionsWithRecordProps<Data, Methods, Computed, Props, Instance extends AnyVue = Vue<Data, Methods, Computed, Props>> =
object &
ComponentOptions<Data, Methods, Computed, Props> &
ComponentOptions<Data | ((this: Record<keyof Props, any> & AnyVue) => Data), Methods, Computed, Props> &
ThisType<Data & Methods & Computed & Record<keyof Props, any> & Instance>;

/**
Expand All @@ -71,7 +71,7 @@ export type FunctionalOrStandardComponentOptions<Data, Methods, Computed, PropNa


export interface ComponentOptions<Data, Methods, Computed, Props> {
data?: Data | (() => Data);
data?: Data;
props?: Props;
propsData?: Object;
computed?: Accessors<Computed>;
Expand Down

0 comments on commit 540a38f

Please sign in to comment.