Skip to content

Commit 69cd3c1

Browse files
committed
feat(cdk): extract sub packages
1 parent bc0635d commit 69cd3c1

8 files changed

Lines changed: 45 additions & 2 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3+
"lib": {
4+
"entryFile": "src/public-api.ts"
5+
}
6+
}

packages/cdk/dialog/src/dialog.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { DialogConfig, DialogRef } from '@angular/cdk/dialog';
2+
3+
const TYPES = Symbol('TYPES');
4+
5+
export abstract class DialogIoTypes<Input, Output> {
6+
[TYPES]?: [Input, Output];
7+
}
8+
9+
export type DialogInputOf<T extends DialogIoTypes<any, any>> =
10+
T extends DialogIoTypes<infer Input, any> ? Input : never;
11+
12+
export type DialogOutputOf<T extends DialogIoTypes<any, any>> =
13+
T extends DialogIoTypes<any, infer Output> ? Output : never;
14+
15+
export type DialogRefOf<T extends DialogIoTypes<any, any>> = DialogRef<
16+
DialogOutputOf<T>,
17+
T
18+
>;
19+
20+
export type DialogConfigOf<T extends DialogIoTypes<any, any>> = DialogConfig<
21+
DialogInputOf<T>,
22+
DialogRefOf<T>
23+
>;
24+
25+
export function createDialogConfig<T extends DialogIoTypes<any, any>>(
26+
config: DialogConfigOf<T>,
27+
): typeof config {
28+
return config;
29+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dialog';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
3+
"lib": {
4+
"entryFile": "src/public-api.ts"
5+
}
6+
}
File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './named-breakpoint-observer';

packages/cdk/src/public-api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export * from './dialog';
2-
export * from './named-breakpoint-observer';
1+
export {};

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"forceConsistentCasingInFileNames": true,
2222
"paths": {
2323
"@angularity/cdk": ["./dist/cdk"],
24+
"@angularity/cdk/*": ["./dist/cdk/*"],
2425
"@angularity/command-flow": ["./dist/command-flow"],
2526
"@angularity/command-flow/*": ["./dist/command-flow/*"],
2627
"@angularity/config-files": ["./dist/config-files"],

0 commit comments

Comments
 (0)