@ngneers/controls-custom-types 0.0.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 NGneers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # @ngneers/controls-custom-types
2
+
3
+ Shared TypeScript type contracts used across
4
+ **[@ngneers/controls](https://ngneers.dev)** and
5
+ [`@ngneers/controls-themes`](https://www.npmjs.com/package/@ngneers/controls-themes).
6
+
7
+ This package holds only type definitions (e.g. icon and token contracts) that both the
8
+ controls and the themes depend on, so the two packages stay in lockstep without a runtime
9
+ dependency between them. You normally don't install it directly — it comes in as a
10
+ transitive dependency of `@ngneers/controls`.
11
+
12
+ ## License
13
+
14
+ MIT © NGneers
package/color.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import type { NgnCustomTypes, NgnThemeTypes } from './custom-types';
2
+ type GetCustomType<Group> = Group extends {
3
+ color: infer T;
4
+ } ? T : never;
5
+ type CustomColorInt = GetCustomType<NgnCustomTypes> extends never ? GetCustomType<NgnThemeTypes> : GetCustomType<NgnCustomTypes>;
6
+ export type CustomColor = CustomColorInt extends readonly (infer A)[] ? A : never;
7
+ export {};
8
+ //# sourceMappingURL=color.d.ts.map
package/color.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../src/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpE,KAAK,aAAa,CAAC,KAAK,IAAI,KAAK,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAEzE,KAAK,cAAc,GACjB,aAAa,CAAC,cAAc,CAAC,SAAS,KAAK,GACvC,aAAa,CAAC,aAAa,CAAC,GAC5B,aAAa,CAAC,cAAc,CAAC,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,cAAc,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC"}
package/color.js ADDED
File without changes
@@ -0,0 +1,5 @@
1
+ export interface NgnCustomTypes {
2
+ }
3
+ export interface NgnThemeTypes {
4
+ }
5
+ //# sourceMappingURL=custom-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-types.d.ts","sourceRoot":"","sources":["../src/custom-types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,cAAc;CAE9B;AAED,MAAM,WAAW,aAAa;CAE7B"}
File without changes
package/icon.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import type { NgnCustomTypes } from './custom-types';
2
+ import type { IconifyIcon } from '@iconify/types';
3
+ export interface NgnIconEntry {
4
+ icon: IconifyIcon;
5
+ scale?: number;
6
+ }
7
+ export type IconType = NgnCustomTypes extends {
8
+ icon: infer T;
9
+ } ? T : IconifyIcon | NgnIconEntry;
10
+ //# sourceMappingURL=icon.d.ts.map
package/icon.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../src/icon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,QAAQ,GAAG,cAAc,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,WAAW,GAAG,YAAY,CAAC"}
package/icon.js ADDED
File without changes
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from './color';
2
+ export * from './custom-types';
3
+ export * from './icon';
4
+ export * from './kind';
5
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
package/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from './color';
2
+ export * from './custom-types';
3
+ export * from './icon';
4
+ export * from './kind';
package/kind.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { NgnCustomTypes, NgnThemeTypes } from './custom-types';
2
+ type GetCustomType<Group, K> = K extends string ? Group extends {
3
+ kind: {
4
+ [key in K]: infer T;
5
+ };
6
+ } ? T : never : never;
7
+ type CustomKindInt<K> = GetCustomType<NgnCustomTypes, K> extends never ? GetCustomType<NgnThemeTypes, K> : GetCustomType<NgnCustomTypes, K>;
8
+ type UnionCustomKind<K> = CustomKindInt<K> extends readonly (infer A)[] ? A : never;
9
+ export type CustomKind<K> = UnionCustomKind<K> extends never ? never : UnionCustomKind<K>;
10
+ export {};
11
+ //# sourceMappingURL=kind.d.ts.map
package/kind.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../src/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpE,KAAK,aAAa,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,SAAS,MAAM,GAC3C,KAAK,SAAS;IAAE,IAAI,EAAE;SAAG,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;KAAE,CAAA;CAAE,GAC7C,CAAC,GACD,KAAK,GACP,KAAK,CAAC;AAEV,KAAK,aAAa,CAAC,CAAC,IAClB,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,KAAK,GAC1C,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC,GAC/B,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;AAEvC,KAAK,eAAe,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAEpF,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC"}
package/kind.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@ngneers/controls-custom-types",
3
+ "version": "0.0.1-next.0",
4
+ "description": "Shared TypeScript type contracts used across @ngneers/controls and its themes.",
5
+ "license": "MIT",
6
+ "homepage": "https://ngneers.dev",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/NGneers/controls.git",
10
+ "directory": "packages/custom-types"
11
+ },
12
+ "keywords": [
13
+ "angular",
14
+ "types",
15
+ "typescript",
16
+ "ngneers-controls"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "type": "module",
22
+ "main": "./index.js",
23
+ "types": "./index.d.ts",
24
+ "dependencies": {
25
+ "@iconify/types": "^2.0.0",
26
+ "tslib": "^2.8.1"
27
+ },
28
+ "sideEffects": true,
29
+ "exports": {
30
+ ".": {
31
+ "import": "./index.js",
32
+ "types": "./index.d.ts"
33
+ }
34
+ }
35
+ }