Skip to content

Commit 86f6605

Browse files
committed
fix: allow nullable values again
Closes: ngneat#119 Angular 18 requires TS 5.4+ which breaks the NonNullable type: microsoft/TypeScript#56644 This reintroduces issue ngneat#81. This commit replaces NonNullable with Exclude to allow correct typing of ExtractRefProp and fix the issue where opening dialogs containing undefined values throws TS2769 when trying to set the data property.
1 parent f8da4bf commit 86f6605

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libs/dialog/src/lib/types.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ export type JustProps<T extends object> = Pick<
5959
}[keyof T]
6060
>;
6161

62-
export type ExtractRefProp<T> = NonNullable<
62+
export type ExtractRefProp<T> = Exclude<
6363
{
6464
[P in keyof T]: T[P] extends DialogRef ? P : never;
65-
}[keyof T]
65+
}[keyof T],
66+
undefined | null
6667
>;
6768

6869
export type ExtractData<T> = ExtractRefProp<T> extends never

0 commit comments

Comments
 (0)