@stamhoofd/types 2.120.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.md +32 -0
- package/README.md +38 -0
- package/dist/Country.d.ts +18 -0
- package/dist/Country.d.ts.map +1 -0
- package/dist/Country.js +19 -0
- package/dist/Country.js.map +1 -0
- package/dist/Language.d.ts +6 -0
- package/dist/Language.d.ts.map +1 -0
- package/dist/Language.js +7 -0
- package/dist/Language.js.map +1 -0
- package/dist/MemberNumberAlgorithm.d.ts +5 -0
- package/dist/MemberNumberAlgorithm.d.ts.map +1 -0
- package/dist/MemberNumberAlgorithm.js +6 -0
- package/dist/MemberNumberAlgorithm.js.map +1 -0
- package/dist/StringLikeObject.d.ts +18 -0
- package/dist/StringLikeObject.d.ts.map +1 -0
- package/dist/StringLikeObject.js +2 -0
- package/dist/StringLikeObject.js.map +1 -0
- package/package.json +25 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Free Use License for Non-Profit Organizations
|
|
2
|
+
|
|
3
|
+
Copyright 2020 Codawood BV
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any non-profit organization with fewer than 2,000 members (each, a “Licensee”), to use this software and associated documentation files (the “Software”), subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
1. Eligibility:
|
|
8
|
+
This license applies only if neither the Licensee nor, if applicable, its parent or umbrella organization, is already subject to an existing license for this project. For the purposes of this license, a “parent or umbrella organization” means any organization with which the Licensee is affiliated, coordinated, or represented as part of a larger collective, including but not limited to national associations or federations.
|
|
9
|
+
|
|
10
|
+
2. Modifications:
|
|
11
|
+
Modifications to the Software are permitted only if they are published publicly under the MIT License, covering only the modifications; the original Software remains under this license and may not be sublicensed without a separate agreement. Any modification made by a Licensee (other than modifications by the original author, its representatives, or the copyright owner) shall be deemed to be distributed under the MIT License. Submission of modifications through publicly accessible channels, including but not limited to pull requests on code repositories such as GitHub, shall be considered an explicit acknowledgment and grant by the Licensee that such modifications are made available under the MIT License. Licensees may not sublicense, transfer, or assign the rights granted under this license except as expressly permitted herein.
|
|
12
|
+
|
|
13
|
+
3. Precedence of Existing Licenses:
|
|
14
|
+
If the Licensee, or its parent or umbrella organization, is already subject to an existing license for this project, that license shall take precedence, and no additional free license is granted. Nothing in this license shall be construed to override any pre-existing exclusive license agreement.
|
|
15
|
+
|
|
16
|
+
4. Data Protection / GDPR Responsibility:
|
|
17
|
+
Licensees are solely responsible for ensuring that any processing of personal data using this software complies with applicable data protection laws, including the EU General Data Protection Regulation (GDPR).
|
|
18
|
+
|
|
19
|
+
5. Termination and Revocation:
|
|
20
|
+
The copyright holders may revoke this license at any time, at their sole discretion.
|
|
21
|
+
|
|
22
|
+
6. Governing Law:
|
|
23
|
+
This license shall be governed by and construed in accordance with the laws of Belgium, without regard to conflict of law principles.
|
|
24
|
+
|
|
25
|
+
7. Third-Party Licenses:
|
|
26
|
+
Certain files or components included in the Software may be governed by separate licenses, including open-source licenses, or contributed by third parties under different terms. Such files are not automatically covered by this license. Licensees are responsible for reviewing and complying with any additional license terms that apply to these files.
|
|
27
|
+
|
|
28
|
+
For the purposes of this license, a “non-profit organization” means an entity recognized as non-profit under applicable law in its jurisdiction, which does not distribute profits to its members or owners.
|
|
29
|
+
|
|
30
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
31
|
+
|
|
32
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @stamhoofd/types
|
|
2
|
+
|
|
3
|
+
Enums and constants that are shared across the entire monorepo, including the global environment (`stamhoofd.d.ts`).
|
|
4
|
+
|
|
5
|
+
## Why does this package exist?
|
|
6
|
+
|
|
7
|
+
The global environment (`STAMHOOFD`) is typed using declarations in `stamhoofd.d.ts`. Those declarations sometimes reference enums — for example, `MEMBER_NUMBER_ALGORITHM` is typed as `MemberNumberAlgorithm`. That enum needs to be defined somewhere that produces real JavaScript at runtime, not just types.
|
|
8
|
+
|
|
9
|
+
The natural place would be `@stamhoofd/structures`, but `stamhoofd.d.ts` is included by packages that `@stamhoofd/structures` itself depends on. Importing from `@stamhoofd/structures` there would create a circular dependency.
|
|
10
|
+
|
|
11
|
+
`@stamhoofd/types` solves this by sitting at the very bottom of the dependency graph — **it has no internal dependencies**. Everything else can import from it; it imports from nothing.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
@stamhoofd/types ← no internal deps
|
|
15
|
+
↑
|
|
16
|
+
stamhoofd.d.ts ← global environment types
|
|
17
|
+
↑
|
|
18
|
+
@stamhoofd/structures ← general shared types and models
|
|
19
|
+
↑
|
|
20
|
+
packages...
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What belongs here
|
|
24
|
+
|
|
25
|
+
- Enums referenced in `stamhoofd.d.ts`
|
|
26
|
+
- Constants that are referenced before any package is initialized
|
|
27
|
+
|
|
28
|
+
If you find yourself wanting to add something here that is **not** needed by the global environment, it probably belongs in `@stamhoofd/structures` instead.
|
|
29
|
+
|
|
30
|
+
## What does NOT belong here
|
|
31
|
+
|
|
32
|
+
- Types or classes that are only used in application code → `@stamhoofd/structures`
|
|
33
|
+
- Business logic of any kind → domain packages
|
|
34
|
+
- Anything that would require importing another internal package → it cannot go here, as that would break the zero-dependency constraint
|
|
35
|
+
|
|
36
|
+
## The zero-dependency rule
|
|
37
|
+
|
|
38
|
+
This package **must never import from another internal `@stamhoofd/*` package**. This constraint is what prevents circular dependencies. If you feel the urge to add an internal import, that is a signal that the thing you are adding does not belong here.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum Country {
|
|
2
|
+
Belgium = "BE",
|
|
3
|
+
Netherlands = "NL",
|
|
4
|
+
Luxembourg = "LU",
|
|
5
|
+
France = "FR",
|
|
6
|
+
Germany = "DE",
|
|
7
|
+
Sweden = "SE",
|
|
8
|
+
UnitedKingdom = "GB",
|
|
9
|
+
Switzerland = "CH",
|
|
10
|
+
Afghanistan = "AF",
|
|
11
|
+
CzechRepublic = "CZ",
|
|
12
|
+
UnitedStates = "US",
|
|
13
|
+
Austria = "AT",
|
|
14
|
+
Portugal = "PT",
|
|
15
|
+
Other = "OTHER"
|
|
16
|
+
}
|
|
17
|
+
export type CountryCode = Exclude<Country, Country.Other>;
|
|
18
|
+
//# sourceMappingURL=Country.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Country.d.ts","sourceRoot":"","sources":["../src/Country.ts"],"names":[],"mappings":"AACA,oBAAY,OAAO;IACf,OAAO,OAAO;IACd,WAAW,OAAO;IAClB,UAAU,OAAO;IACjB,MAAM,OAAO;IACb,OAAO,OAAO;IACd,MAAM,OAAO;IACb,aAAa,OAAO;IACpB,WAAW,OAAO;IAClB,WAAW,OAAO;IAClB,aAAa,OAAO;IACpB,YAAY,OAAO;IACnB,OAAO,OAAO;IACd,QAAQ,OAAO;IACf,KAAK,UAAU;CAClB;AACD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/Country.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// The Country enum is also defined in environment.d.ts - they should remain in sync to avoid compilation errors
|
|
2
|
+
export var Country;
|
|
3
|
+
(function (Country) {
|
|
4
|
+
Country["Belgium"] = "BE";
|
|
5
|
+
Country["Netherlands"] = "NL";
|
|
6
|
+
Country["Luxembourg"] = "LU";
|
|
7
|
+
Country["France"] = "FR";
|
|
8
|
+
Country["Germany"] = "DE";
|
|
9
|
+
Country["Sweden"] = "SE";
|
|
10
|
+
Country["UnitedKingdom"] = "GB";
|
|
11
|
+
Country["Switzerland"] = "CH";
|
|
12
|
+
Country["Afghanistan"] = "AF";
|
|
13
|
+
Country["CzechRepublic"] = "CZ";
|
|
14
|
+
Country["UnitedStates"] = "US";
|
|
15
|
+
Country["Austria"] = "AT";
|
|
16
|
+
Country["Portugal"] = "PT";
|
|
17
|
+
Country["Other"] = "OTHER";
|
|
18
|
+
})(Country || (Country = {}));
|
|
19
|
+
//# sourceMappingURL=Country.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Country.js","sourceRoot":"","sources":["../src/Country.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,MAAM,CAAN,IAAY,OAeX;AAfD,WAAY,OAAO;IACf,yBAAc,CAAA;IACd,6BAAkB,CAAA;IAClB,4BAAiB,CAAA;IACjB,wBAAa,CAAA;IACb,yBAAc,CAAA;IACd,wBAAa,CAAA;IACb,+BAAoB,CAAA;IACpB,6BAAkB,CAAA;IAClB,6BAAkB,CAAA;IAClB,+BAAoB,CAAA;IACpB,8BAAmB,CAAA;IACnB,yBAAc,CAAA;IACd,0BAAe,CAAA;IACf,0BAAe,CAAA;AACnB,CAAC,EAfW,OAAO,KAAP,OAAO,QAelB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Language.d.ts","sourceRoot":"","sources":["../src/Language.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAChB,KAAK,OAAO;IACZ,OAAO,OAAO;IACd,MAAM,OAAO;CAChB"}
|
package/dist/Language.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Language.js","sourceRoot":"","sources":["../src/Language.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAChB,wBAAY,CAAA;IACZ,0BAAc,CAAA;IACd,yBAAa,CAAA;AACjB,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemberNumberAlgorithm.d.ts","sourceRoot":"","sources":["../src/MemberNumberAlgorithm.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC7B,GAAG,QAAQ;IACX,WAAW,gBAAgB;CAC9B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var MemberNumberAlgorithm;
|
|
2
|
+
(function (MemberNumberAlgorithm) {
|
|
3
|
+
MemberNumberAlgorithm["KSA"] = "KSA";
|
|
4
|
+
MemberNumberAlgorithm["Incremental"] = "Incremental";
|
|
5
|
+
})(MemberNumberAlgorithm || (MemberNumberAlgorithm = {}));
|
|
6
|
+
//# sourceMappingURL=MemberNumberAlgorithm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemberNumberAlgorithm.js","sourceRoot":"","sources":["../src/MemberNumberAlgorithm.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,oDAA2B,CAAA;AAC/B,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface StringLikeObject {
|
|
2
|
+
toString(): string;
|
|
3
|
+
trim(): string;
|
|
4
|
+
toLocaleLowerCase(): string;
|
|
5
|
+
toLocaleUpperCase(): string;
|
|
6
|
+
toUpperCase(): string;
|
|
7
|
+
toLowerCase(): string;
|
|
8
|
+
substr(start: number, length?: number): string;
|
|
9
|
+
substring(start: number, end?: number): string;
|
|
10
|
+
length: number;
|
|
11
|
+
valueOf(): string;
|
|
12
|
+
normalize(form?: string): string;
|
|
13
|
+
replace(searchValue: string | RegExp, replaceValue: string): string;
|
|
14
|
+
charAt(index: number): string;
|
|
15
|
+
slice(start: number, end?: number): string;
|
|
16
|
+
split(separator: string | RegExp, limit?: number): string[];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=StringLikeObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringLikeObject.d.ts","sourceRoot":"","sources":["../src/StringLikeObject.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,IAAI,MAAM,CAAC;IACnB,IAAI,IAAI,MAAM,CAAC;IACf,iBAAiB,IAAI,MAAM,CAAC;IAC5B,iBAAiB,IAAI,MAAM,CAAC;IAC5B,WAAW,IAAI,MAAM,CAAC;IACtB,WAAW,IAAI,MAAM,CAAC;IACtB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,IAAI,MAAM,CAAC;IAClB,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IACpE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringLikeObject.js","sourceRoot":"","sources":["../src/StringLikeObject.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stamhoofd/types",
|
|
3
|
+
"version": "2.120.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./*": {
|
|
7
|
+
"types": "./dist/*.d.ts",
|
|
8
|
+
"import": "./dist/*.js",
|
|
9
|
+
"require": "./dist/*.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"package.json"
|
|
15
|
+
],
|
|
16
|
+
"license": "UNLICENCED",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc --build tsconfig.build.json",
|
|
19
|
+
"lint": "eslint"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"gitHead": "f38f79c15ce16b0c8c14743ff3eb61feda5a18d4"
|
|
25
|
+
}
|