@aglyn/shared-data-types 1.0.0-beta.143
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 +201 -0
- package/README.md +7 -0
- package/package.json +34 -0
- package/src/index.d.ts +23 -0
- package/src/index.js +25 -0
- package/src/index.js.map +1 -0
- package/src/lib/crud.d.ts +42 -0
- package/src/lib/crud.js +21 -0
- package/src/lib/crud.js.map +1 -0
- package/src/lib/dod.d.ts +345 -0
- package/src/lib/dod.js +150 -0
- package/src/lib/dod.js.map +1 -0
- package/src/lib/host-theme.d.ts +138 -0
- package/src/lib/host-theme.js +25 -0
- package/src/lib/host-theme.js.map +1 -0
- package/src/lib/initializable.d.ts +46 -0
- package/src/lib/initializable.js +23 -0
- package/src/lib/initializable.js.map +1 -0
- package/src/lib/lifecycle.d.ts +39 -0
- package/src/lib/lifecycle.js +18 -0
- package/src/lib/lifecycle.js.map +1 -0
- package/src/lib/normalized.d.ts +92 -0
- package/src/lib/normalized.js +28 -0
- package/src/lib/normalized.js.map +1 -0
- package/src/lib/semantic.d.ts +26 -0
- package/src/lib/semantic.js +18 -0
- package/src/lib/semantic.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/data/types/src/lib/host-theme.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Persisted host theme document types.\n *\n * These are plain-JSON (Firestore round-trippable) descriptions of a MUI\n * theme. They intentionally carry no MUI imports so data-scope libs can\n * depend on them; `@aglyn/shared-ui-theme` owns the conversion into runtime\n * `ThemeOptions`.\n */\n\nexport type HostThemeScheme = 'light' | 'dark'\n\nexport interface HostThemePaletteColor {\n main: string\n light?: string\n dark?: string\n contrastText?: string\n}\n\n/**\n * Pale washes of the three accents, used as SURFACES (AGL-1244).\n *\n * Deliberately NOT a {@link HostThemePaletteColor}: a tint has no ramp and no\n * `contrastText`, because it is never a component `color`. It is the fill\n * behind an icon that is already `primary.dark` / `secondary.main` /\n * `tertiary.main`, so its members are named after the accent they belong to\n * rather than after a shade. Same shape as `background` and `text` — a group\n * of string leaves — which is why the theme editor reads and writes it\n * through the same path-based fields.\n */\nexport interface HostThemeTintColors {\n primary?: string\n secondary?: string\n tertiary?: string\n}\n\n/** Palette color keys supported per scheme, including repo-custom ones. */\nexport interface HostThemeSchemeColors {\n primary?: HostThemePaletteColor\n secondary?: HostThemePaletteColor\n tertiary?: HostThemePaletteColor\n surface?: HostThemePaletteColor\n error?: HostThemePaletteColor\n warning?: HostThemePaletteColor\n info?: HostThemePaletteColor\n success?: HostThemePaletteColor\n background?: {\n default?: string\n paper?: string\n }\n text?: {\n primary?: string\n secondary?: string\n disabled?: string\n }\n tint?: HostThemeTintColors\n divider?: string\n}\n\nexport interface HostThemeFont {\n /** Font family name, e.g. \"Inter\". */\n family: string\n weights?: Array<number>\n /** Where the tenant loads the font from; system fonts need no loading. */\n source?: 'google' | 'system'\n}\n\nexport type HostThemeTypographyVariantKey =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'button'\n | 'caption'\n | 'overline'\n\nexport interface HostThemeTypographyVariant {\n fontFamily?: string\n fontSize?: string | number\n fontWeight?: number\n lineHeight?: string | number\n letterSpacing?: string | number\n textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase'\n}\n\nexport interface HostThemeTypography {\n /** CSS font-family stack applied theme-wide. */\n fontFamily?: string\n variants?: {\n [P in HostThemeTypographyVariantKey]?: HostThemeTypographyVariant\n }\n}\n\n/**\n * Plain-JSON component override: serialized `defaultProps` and\n * `styleOverrides` (slot name -> CSS object). Functions are not\n * representable by design.\n */\nexport interface HostThemeComponentOverride {\n defaultProps?: Record<string, unknown>\n styleOverrides?: Record<string, unknown>\n}\n\n/**\n * Plain-JSON theme mixins.\n *\n * `toolbar` is the only one a host can set, and it exists because it is the\n * ONLY way to change toolbar height from data (AGL-1242). MUI builds the\n * Toolbar's `regular` variant style FROM `theme.mixins.toolbar`, and applies\n * that variant AFTER `components.MuiToolbar.styleOverrides` — so a slot\n * override can never win, no matter how it is written. The value is a CSS\n * object and may nest media queries, e.g.\n * `{ minHeight: '56px', '@media (min-width:600px)': { minHeight: '72px' } }`.\n */\nexport interface HostThemeMixins {\n toolbar?: Record<string, unknown>\n}\n\nexport interface HostTheme {\n colorSchemes?: {\n [P in HostThemeScheme]?: HostThemeSchemeColors\n }\n typography?: HostThemeTypography\n fonts?: Array<HostThemeFont>\n shape?: {\n borderRadius?: number\n }\n spacing?: number\n mixins?: HostThemeMixins\n /** Keyed by MUI component slot name (e.g. `MuiButton`). Consumers validate against a whitelist. */\n components?: Record<string, HostThemeComponentOverride>\n /**\n * Whether visitors get a dark scheme. Absent (`'auto'`) follows the\n * visitor's system setting or their choice in the theme mode switcher,\n * rendering the platform's default dark palette under whatever dark colors\n * the site authored. `'off'` keeps every visitor on light — for a site whose\n * content carries light-only backgrounds — and hides the switcher on\n * published pages.\n */\n darkScheme?: 'auto' | 'off'\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;CAOC,GAoHD,WAsBC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Init hooks for object methods
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @interface Initializable
|
|
22
|
+
*/
|
|
23
|
+
export interface Initializable {
|
|
24
|
+
/**
|
|
25
|
+
* Hook to be called from and at the beginning
|
|
26
|
+
* of Initializable.init
|
|
27
|
+
*
|
|
28
|
+
* @memberof Initializable
|
|
29
|
+
*/
|
|
30
|
+
preInit?(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Hook to be called after initialization of the
|
|
33
|
+
* object (e.g., new Initializable().init())
|
|
34
|
+
*
|
|
35
|
+
* @returns {this}
|
|
36
|
+
* @memberof Initializable
|
|
37
|
+
*/
|
|
38
|
+
init(): this;
|
|
39
|
+
/**
|
|
40
|
+
* Hook to be called from and at the end of
|
|
41
|
+
* Initializable.init
|
|
42
|
+
*
|
|
43
|
+
* @memberof Initializable
|
|
44
|
+
*/
|
|
45
|
+
onInit?(): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* Init hooks for object methods
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface Initializable
|
|
21
|
+
*/ export { };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=initializable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/data/types/src/lib/initializable.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Init hooks for object methods\n *\n * @export\n * @interface Initializable\n */\nexport interface Initializable {\n\n /**\n * Hook to be called from and at the beginning\n * of Initializable.init\n *\n * @memberof Initializable\n */\n preInit?(): void\n\n /**\n * Hook to be called after initialization of the\n * object (e.g., new Initializable().init())\n *\n * @returns {this}\n * @memberof Initializable\n */\n init(): this\n\n /**\n * Hook to be called from and at the end of\n * Initializable.init\n *\n * @memberof Initializable\n */\n onInit?(): void\n\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;CAKC,GACD,WA2BC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/** Observers to handle life cycle onInit/onDestroy events */
|
|
18
|
+
export interface LifecycleObserver {
|
|
19
|
+
/**
|
|
20
|
+
* Should be invoked once immediately after instantiation
|
|
21
|
+
*/
|
|
22
|
+
onInit?(...args: unknown[]): unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Should be invoked once as last step before garbage collection
|
|
25
|
+
*/
|
|
26
|
+
onDestroy?(...args: unknown[]): unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface LoadableObserver {
|
|
29
|
+
/**
|
|
30
|
+
* Should be invoked each time the object is loaded
|
|
31
|
+
*/
|
|
32
|
+
onLoad?(...args: unknown[]): unknown;
|
|
33
|
+
/**
|
|
34
|
+
* Should be invoked each time the object is unloaded
|
|
35
|
+
*/
|
|
36
|
+
onUnload?(...args: unknown[]): unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface LoadableLifecycleObserver extends LoadableObserver, LifecycleObserver {
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /** Observers to handle life cycle onInit/onDestroy events */ export { };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/data/types/src/lib/lifecycle.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** Observers to handle life cycle onInit/onDestroy events */\nexport interface LifecycleObserver {\n /**\n * Should be invoked once immediately after instantiation\n */\n onInit?(...args: unknown[]): unknown\n /**\n * Should be invoked once as last step before garbage collection\n */\n onDestroy?(...args: unknown[]): unknown\n}\n\nexport interface LoadableObserver {\n /**\n * Should be invoked each time the object is loaded\n */\n onLoad?(...args: unknown[]): unknown\n /**\n * Should be invoked each time the object is unloaded\n */\n onUnload?(...args: unknown[]): unknown\n}\n\nexport interface LoadableLifecycleObserver extends LoadableObserver, LifecycleObserver {\n\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,2DAA2D,GAuB3D,WAEC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
type ID = string | symbol;
|
|
18
|
+
/** Normalized local state design for interfacing with 3NF rules */
|
|
19
|
+
export type NormalizedData<T = any, K extends ID = ID> = {
|
|
20
|
+
ids: K[];
|
|
21
|
+
byId: {
|
|
22
|
+
[P in K]?: T;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Normalized data for 3NF
|
|
27
|
+
* @see https://en.wikipedia.org/wiki/Third_normal_form
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @interface NormalizedModel
|
|
31
|
+
* @extends {NormalizedData<T, K>}
|
|
32
|
+
* @extends {Serializable<NormalizedData<T, K>>}
|
|
33
|
+
* @template T
|
|
34
|
+
* @template K
|
|
35
|
+
*/
|
|
36
|
+
export interface NormalizedModel<T = any, K extends ID = ID> extends NormalizedData<T, K>, Serializable<NormalizedData<T, K>> {
|
|
37
|
+
readonly length: number;
|
|
38
|
+
/**
|
|
39
|
+
* The properties to keep when object is passed to JSON.stringify(...)
|
|
40
|
+
* @returns {NormalizedData<T, K>}
|
|
41
|
+
* @memberof NormalizedModel
|
|
42
|
+
*/
|
|
43
|
+
toJSON(): NormalizedData<T, K>;
|
|
44
|
+
/**
|
|
45
|
+
* Converts the current values into an array ordered by the
|
|
46
|
+
* appearance of the key in ids array
|
|
47
|
+
* @returns {Array<T>}
|
|
48
|
+
* @memberof NormalizedModel
|
|
49
|
+
*/
|
|
50
|
+
toArray(): Array<T>;
|
|
51
|
+
/**
|
|
52
|
+
* Clears all values
|
|
53
|
+
* @returns {this}
|
|
54
|
+
* @memberof NormalizedModel
|
|
55
|
+
*/
|
|
56
|
+
clear(): this;
|
|
57
|
+
/**
|
|
58
|
+
* Aliases the static method to shortcut delete operations on this instance
|
|
59
|
+
*
|
|
60
|
+
* @param {K} id
|
|
61
|
+
* @returns {this}
|
|
62
|
+
* @memberof NormalizedModel
|
|
63
|
+
*/
|
|
64
|
+
remove(id: K): this;
|
|
65
|
+
/**
|
|
66
|
+
* Returns whether or not the data byId has property key
|
|
67
|
+
*
|
|
68
|
+
* @param {ID} id
|
|
69
|
+
* @returns {boolean}
|
|
70
|
+
* @memberof NormalizedModel
|
|
71
|
+
*/
|
|
72
|
+
has(id: ID): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Aliases the static method to shortcut set operations on this instance
|
|
75
|
+
*
|
|
76
|
+
* @param {ID} id
|
|
77
|
+
* @param {*} [value]
|
|
78
|
+
* @param {number} [index]
|
|
79
|
+
* @returns {this}
|
|
80
|
+
* @memberof NormalizedModel
|
|
81
|
+
*/
|
|
82
|
+
set(id: ID, value?: T, index?: number): this;
|
|
83
|
+
/**
|
|
84
|
+
* Shortcuts getting the value of properties of the current instance
|
|
85
|
+
*
|
|
86
|
+
* @param {ID} id
|
|
87
|
+
* @returns {(undefined | T)}
|
|
88
|
+
* @memberof NormalizedModel
|
|
89
|
+
*/
|
|
90
|
+
get(id: ID): undefined | T;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* Normalized data for 3NF
|
|
18
|
+
* @see https://en.wikipedia.org/wiki/Third_normal_form
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @interface NormalizedModel
|
|
22
|
+
* @extends {NormalizedData<T, K>}
|
|
23
|
+
* @extends {Serializable<NormalizedData<T, K>>}
|
|
24
|
+
* @template T
|
|
25
|
+
* @template K
|
|
26
|
+
*/ export { };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=normalized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/data/types/src/lib/normalized.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\ntype ID = string | symbol\n\n/** Normalized local state design for interfacing with 3NF rules */\nexport type NormalizedData<T = any, K extends ID = ID> = {\n ids: K[]\n byId: { [P in K]?: T }\n}\n\n/**\n * Normalized data for 3NF\n * @see https://en.wikipedia.org/wiki/Third_normal_form\n *\n * @export\n * @interface NormalizedModel\n * @extends {NormalizedData<T, K>}\n * @extends {Serializable<NormalizedData<T, K>>}\n * @template T\n * @template K\n */\nexport interface NormalizedModel<T = any, K extends ID = ID>\n extends NormalizedData<T, K>,\n Serializable<NormalizedData<T, K>> {\n readonly length: number\n /**\n * The properties to keep when object is passed to JSON.stringify(...)\n * @returns {NormalizedData<T, K>}\n * @memberof NormalizedModel\n */\n toJSON(): NormalizedData<T, K>\n /**\n * Converts the current values into an array ordered by the\n * appearance of the key in ids array\n * @returns {Array<T>}\n * @memberof NormalizedModel\n */\n toArray(): Array<T>\n /**\n * Clears all values\n * @returns {this}\n * @memberof NormalizedModel\n */\n clear(): this\n /**\n * Aliases the static method to shortcut delete operations on this instance\n *\n * @param {K} id\n * @returns {this}\n * @memberof NormalizedModel\n */\n remove(id: K): this\n /**\n * Returns whether or not the data byId has property key\n *\n * @param {ID} id\n * @returns {boolean}\n * @memberof NormalizedModel\n */\n has(id: ID): boolean\n /**\n * Aliases the static method to shortcut set operations on this instance\n *\n * @param {ID} id\n * @param {*} [value]\n * @param {number} [index]\n * @returns {this}\n * @memberof NormalizedModel\n */\n set(id: ID, value?: T, index?: number): this\n /**\n * Shortcuts getting the value of properties of the current instance\n *\n * @param {ID} id\n * @returns {(undefined | T)}\n * @memberof NormalizedModel\n */\n get(id: ID): undefined | T\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAWD;;;;;;;;;;CAUC,GACD,WAyDC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare namespace Version {
|
|
18
|
+
type NiD = string | number;
|
|
19
|
+
type PreName = 'canary' | 'alpha' | 'beta' | 'rc';
|
|
20
|
+
type Major<N extends NiD = 0> = `${N}`;
|
|
21
|
+
type Minor<N extends NiD = 0> = `.${N}`;
|
|
22
|
+
type Patch<N extends NiD = 0> = `.${N}`;
|
|
23
|
+
type Pre<PRN extends OrUndef<PreName> = undefined, PRV extends OrUndef<NiD> = 0> = Conditional<PRN, PreName, Conditional<PRV, NiD, `-${PRN}.${PRV}`, `-${PRN}`>>;
|
|
24
|
+
type Build<N extends OrUndef<NiD> = undefined> = Conditional<N, NiD, `+${N}`>;
|
|
25
|
+
type Semantic<MAJ extends NiD = 0, MIN extends NiD = 0, PAT extends NiD = 0, PRN extends OrUndef<PreName> = undefined, PRV extends OrUndef<NiD> = undefined, BLD extends OrUndef<NiD> = undefined> = `${Major<MAJ>}${Minor<MIN>}${Patch<PAT>}${Pre<PRN, PRV>}${Build<BLD>}`;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export { };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=semantic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/data/types/src/lib/semantic.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport namespace Version {\n // Example:\n // 1.0.0-alpha\n // ^ 1.0.0-alpha.1\n // ^ 1.0.0-alpha.beta\n // ^ 1.0.0-beta\n // ^ 1.0.0-beta.2\n // ^ 1.0.0-beta.11\n // ^ 1.0.0-rc.1\n // ^ 1.0.0.\n\n export type NiD = string | number\n export type PreName = 'canary' | 'alpha' | 'beta' | 'rc'\n\n export type Major<N extends NiD = 0> = `${N}`\n export type Minor<N extends NiD = 0> = `.${N}`\n export type Patch<N extends NiD = 0> = `.${N}`\n\n export type Pre<\n PRN extends OrUndef<PreName> = undefined,\n PRV extends OrUndef<NiD> = 0,\n > = Conditional<\n PRN,\n PreName,\n Conditional<PRV, NiD, `-${PRN}.${PRV}`, `-${PRN}`>\n >\n export type Build<N extends OrUndef<NiD> = undefined> = Conditional<N, NiD, `+${N}`>\n\n export type Semantic<\n MAJ extends NiD = 0,\n MIN extends NiD = 0,\n PAT extends NiD = 0,\n PRN extends OrUndef<PreName> = undefined,\n PRV extends OrUndef<NiD> = undefined,\n BLD extends OrUndef<NiD> = undefined,\n > = `${Major<MAJ>}${Minor<MIN>}${Patch<PAT>}${Pre<PRN, PRV>}${Build<BLD>}`\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,WAoCC"}
|