Skip to content

Commit

Permalink
Unmask types with explicit mode: "unmask" and default to leave the …
Browse files Browse the repository at this point in the history
…type alone (#12252)
  • Loading branch information
jerelmiller authored Jan 9, 2025
1 parent dd3d653 commit cb9cd4e
Show file tree
Hide file tree
Showing 22 changed files with 430 additions and 288 deletions.
12 changes: 7 additions & 5 deletions .api-reports/api-report-cache.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -764,16 +764,18 @@ export function makeReference(id: string): Reference;
// @public (undocumented)
export function makeVar<T>(value: T): ReactiveVar<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// @public (undocumented)
export interface MergeInfo {
Expand Down
10 changes: 6 additions & 4 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1412,11 +1412,13 @@ type MaybeAsync<T> = T | PromiseLike<T>;
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
export type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
export type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// @public (undocumented)
export interface MergeInfo {
Expand Down
10 changes: 6 additions & 4 deletions .api-reports/api-report-masking.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,13 @@ export function maskOperation<TData = unknown>(data: TData, document: DocumentNo
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
export type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
export type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
14 changes: 8 additions & 6 deletions .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1153,16 +1153,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down Expand Up @@ -2411,7 +2413,7 @@ export interface UseReadQueryResult<TData = unknown> {
export function useSubscription<TData = any, TVariables extends OperationVariables = OperationVariables>(subscription: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: SubscriptionHookOptions<NoInfer_2<TData>, NoInfer_2<TVariables>>): {
restart: () => void;
loading: boolean;
data?: MaybeMasked<TData> | undefined;
data?: TData | undefined;
error?: ApolloError;
variables?: TVariables | undefined;
};
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-react_components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1016,16 +1016,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-react_context.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1013,16 +1013,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-react_hoc.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1020,16 +1020,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
14 changes: 8 additions & 6 deletions .api-reports/api-report-react_hooks.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1102,16 +1102,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down Expand Up @@ -2244,7 +2246,7 @@ export interface UseReadQueryResult<TData = unknown> {
export function useSubscription<TData = any, TVariables extends OperationVariables = OperationVariables>(subscription: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: SubscriptionHookOptions<NoInfer_2<TData>, NoInfer_2<TVariables>>): {
restart: () => void;
loading: boolean;
data?: MaybeMasked<TData> | undefined;
data?: TData | undefined;
error?: ApolloError;
variables?: TVariables | undefined;
};
Expand Down
16 changes: 9 additions & 7 deletions .api-reports/api-report-react_internal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ export class InternalQueryReference<TData = unknown> {
// Warning: (ae-forgotten-export) The symbol "FetchMoreOptions" needs to be exported by the entry point index.d.ts
//
// (undocumented)
fetchMore(options: FetchMoreOptions<TData>): Promise<ApolloQueryResult<MaybeMasked<TData>>>;
fetchMore(options: FetchMoreOptions<TData>): Promise<ApolloQueryResult<TData>>;
// (undocumented)
readonly key: QueryKey;
// Warning: (ae-forgotten-export) The symbol "Listener" needs to be exported by the entry point index.d.ts
Expand All @@ -968,7 +968,7 @@ export class InternalQueryReference<TData = unknown> {
// (undocumented)
promise: QueryRefPromise<TData>;
// (undocumented)
refetch(variables: OperationVariables | undefined): Promise<ApolloQueryResult<MaybeMasked<TData>>>;
refetch(variables: OperationVariables | undefined): Promise<ApolloQueryResult<TData>>;
// (undocumented)
reinitialize(): void;
// (undocumented)
Expand Down Expand Up @@ -1112,16 +1112,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-react_ssr.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,16 +998,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-testing.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -987,16 +987,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-testing_core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -986,16 +986,18 @@ interface MaskOperationOptions<TData> {
// @public (undocumented)
type MaybeAsync<T> = T | PromiseLike<T>;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-utilities.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1695,16 +1695,18 @@ type MaybeAsync<T> = T | PromiseLike<T>;
// @public (undocumented)
export function maybeDeepFreeze<T>(obj: T): T;

// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "DataMasking" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
//
// @public
type MaybeMasked<TData> = TData extends any ? true extends IsAny<TData> ? TData : TData extends {
type MaybeMasked<TData> = DataMasking extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : DataMasking extends {
enabled: true;
} ? TData : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never;
} ? Prettify<RemoveMaskedMarker<TData>> : true extends ContainsFragmentsRefs<TData> ? Unmasked<TData> : TData : never : DataMasking extends {
mode: "preserveTypes";
} ? TData : TData;

// @public (undocumented)
export function mergeDeep<T extends any[]>(...sources: T): TupleToIntersection<T>;
Expand Down
Loading

0 comments on commit cb9cd4e

Please sign in to comment.