Skip to content

Commit

Permalink
Revert "Add Element to type BuiltIns (#745)"
Browse files Browse the repository at this point in the history
This reverts commit d42ea80.
  • Loading branch information
sindresorhus committed Nov 17, 2023
1 parent 827c2f1 commit 1b25feb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions source/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export type Subtract<A extends number, B extends number> = BuildTuple<A> extends
: never;

/**
Matches any primitive, `Date`, `RegExp`, `Element` value.
Matches any primitive, `Date`, or `RegExp` value.
*/
export type BuiltIns = Primitive | Date | RegExp | Element;
export type BuiltIns = Primitive | Date | RegExp;

/**
Matches non-recursive types.
Expand Down
13 changes: 0 additions & 13 deletions test-d/partial-deep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const foo = {
bar: {
function: (_: string): void => undefined,
classConstructor: ClassA,
element: document.createElement('div'),
object: {key: 'value'},
string: 'waldo',
number: 1,
Expand Down Expand Up @@ -42,7 +41,6 @@ const instance = new partialDeepFoo.bar!.classConstructor!();
instance.foo = 2;
const b = partialDeepFoo.bar!.constructor;
expectType<((_: string) => void) | undefined>(partialDeepFoo.bar!.function);
expectType<HTMLDivElement | undefined>(partialDeepFoo.bar!.element);
expectAssignable<object | undefined>(partialDeepFoo.bar!.object);
expectType<string | undefined>(partialDeepFoo.bar!.string);
expectType<number | undefined>(partialDeepFoo.bar!.number);
Expand Down Expand Up @@ -102,14 +100,3 @@ expectAssignable<ReadonlyMap<string | undefined, string | undefined> | undefined
expectAssignable<ReadonlySet<string | undefined> | undefined>(partialDeepNoRecurseIntoArraysBar.readonlySet);
expectType<readonly string[] | undefined>(partialDeepNoRecurseIntoArraysBar.readonlyArray);
expectType<readonly ['foo'] | undefined>(partialDeepNoRecurseIntoArraysBar.readonlyTuple);

// Test for interface
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface InterfaceType {
string: string;
object: {
number: number;
};
}
declare const interfaceType: PartialDeep<InterfaceType>;
expectType<{string?: string; object?: {number?: number}}>(interfaceType);

0 comments on commit 1b25feb

Please sign in to comment.