@joookiwi/type 1.0.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.
Files changed (53) hide show
  1. package/README.md +107 -0
  2. package/dist/boolean (false).d.ts +28 -0
  3. package/dist/boolean (false).d.ts.map +1 -0
  4. package/dist/boolean (true).d.ts +29 -0
  5. package/dist/boolean (true).d.ts.map +1 -0
  6. package/dist/boolean.d.ts +42 -0
  7. package/dist/boolean.d.ts.map +1 -0
  8. package/dist/empty.d.ts +51 -0
  9. package/dist/empty.d.ts.map +1 -0
  10. package/dist/index.d.ts +23 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/mixed.d.ts +594 -0
  13. package/dist/mixed.d.ts.map +1 -0
  14. package/dist/nullable.d.ts +769 -0
  15. package/dist/nullable.d.ts.map +1 -0
  16. package/dist/numeric (-1).d.ts +86 -0
  17. package/dist/numeric (-1).d.ts.map +1 -0
  18. package/dist/numeric (0).d.ts +88 -0
  19. package/dist/numeric (0).d.ts.map +1 -0
  20. package/dist/numeric (1).d.ts +88 -0
  21. package/dist/numeric (1).d.ts.map +1 -0
  22. package/dist/numeric (2).d.ts +84 -0
  23. package/dist/numeric (2).d.ts.map +1 -0
  24. package/dist/numeric (bigint).d.ts +41 -0
  25. package/dist/numeric (bigint).d.ts.map +1 -0
  26. package/dist/numeric (number).d.ts +42 -0
  27. package/dist/numeric (number).d.ts.map +1 -0
  28. package/dist/numeric.d.ts +51 -0
  29. package/dist/numeric.d.ts.map +1 -0
  30. package/dist/string (individual).d.ts +33 -0
  31. package/dist/string (individual).d.ts.map +1 -0
  32. package/dist/string.d.ts +43 -0
  33. package/dist/string.d.ts.map +1 -0
  34. package/dist/symbol.d.ts +38 -0
  35. package/dist/symbol.d.ts.map +1 -0
  36. package/package.json +65 -0
  37. package/src/boolean (false).ts +30 -0
  38. package/src/boolean (true).ts +31 -0
  39. package/src/boolean.ts +45 -0
  40. package/src/empty.ts +57 -0
  41. package/src/index.ts +23 -0
  42. package/src/mixed.ts +642 -0
  43. package/src/nullable.ts +837 -0
  44. package/src/numeric (-1).ts +88 -0
  45. package/src/numeric (0).ts +90 -0
  46. package/src/numeric (1).ts +90 -0
  47. package/src/numeric (2).ts +86 -0
  48. package/src/numeric (bigint).ts +44 -0
  49. package/src/numeric (number).ts +45 -0
  50. package/src/numeric.ts +55 -0
  51. package/src/string (individual).ts +35 -0
  52. package/src/string.ts +59 -0
  53. package/src/symbol.ts +40 -0
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@joookiwi/type",
3
+ "version": "1.0.0",
4
+ "description": "A typescript project to encapsulate a bunch of common type-aliases",
5
+
6
+ "scripts": {
7
+ "clear-dist-folder": "del-cli dist/",
8
+
9
+ "build": "tsc",
10
+
11
+ "test-pack": "npm pack --dry-run",
12
+ "test-publish": "npm publish --@access=public --dry-run",
13
+
14
+ "pack": "npm pack",
15
+
16
+ "local-publish": "npm link",
17
+ "publish-to-npm": "npm publish --access=public"
18
+ },
19
+
20
+ "directories": {
21
+ "lib": "./src",
22
+ "test": "./test"
23
+ },
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": { "types": "./dist/index.d.ts" },
27
+ "./*": { "types": "./dist/*.d.ts" }
28
+ },
29
+
30
+ "files": [
31
+ "dist",
32
+ "src",
33
+ "README.md"
34
+ ],
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/joooKiwi/types.git"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/joooKiwi/types/issues"
41
+ },
42
+
43
+ "keywords": [
44
+ "type-alias",
45
+ "types",
46
+ "nullable types",
47
+ "boolean types",
48
+ "bigint types",
49
+ "character types",
50
+ "empty types",
51
+ "number types",
52
+ "numeric types",
53
+ "string types"
54
+ ],
55
+ "funding": [
56
+ { "type": "github", "url": "https://github.com/sponsors/joooKiwi" },
57
+ { "type": "buy-me-a-coffee", "url": "https://www.buymeacoffee.com/joookiwi" }
58
+ ],
59
+ "author": "JóôòKiwi",
60
+ "license": "MIT",
61
+ "devDependencies": {
62
+ "del-cli": "^5.1.0",
63
+ "typescript": "^5.4.2"
64
+ }
65
+ }
@@ -0,0 +1,30 @@
1
+ /*******************************************************************************
2
+ Copyright (c) 2023-2024. Jonathan Bédard ~ JóôòKiwi
3
+
4
+ This project is free to use.
5
+ All the right is reserved to the author of this project.
6
+ ******************************************************************************/
7
+
8
+ /** A type-alias for the {@link Boolean} <b>false</b> as a primitive */
9
+ export type False<T extends false = false, > = T
10
+
11
+ /**
12
+ * A type-alias for the {@link Boolean} <b>false</b>
13
+ * in a {@link String} template
14
+ *
15
+ * @see False
16
+ * @see Template
17
+ * @see BooleanTemplate
18
+ */
19
+ export type FalseTemplate<T extends false = false, > = `${T}`
20
+
21
+ /**
22
+ * A type-alias for the {@link Boolean} <b>false</b>
23
+ * as a primitive or in a {@link String} template
24
+ *
25
+ * @see False
26
+ * @see Template
27
+ * @see FalseOrTemplateOrObject
28
+ * @see TemplateOrBoolean
29
+ */
30
+ export type TemplateOrFalse<T extends false = false, > = | T | `${T}`
@@ -0,0 +1,31 @@
1
+ /*******************************************************************************
2
+ Copyright (c) 2023-2024. Jonathan Bédard ~ JóôòKiwi
3
+
4
+ This project is free to use.
5
+ All the right is reserved to the author of this project.
6
+ ******************************************************************************/
7
+
8
+ /** A type-alias for the {@link Boolean} <b>true</b> as a primitive */
9
+ export type True<T extends true = true, > = T
10
+
11
+ /**
12
+ * A type-alias for the {@link Boolean} <b>true</b>
13
+ * in a {@link String} template
14
+ *
15
+ * @see True
16
+ * @see Template
17
+ * @see BooleanTemplate
18
+ */
19
+ export type TrueTemplate<T extends true = true, > = `${T}`
20
+
21
+ /**
22
+ * A type-alias for the {@link Boolean} <b>true</b>
23
+ * in a {@link String} template
24
+ *
25
+ * @see True
26
+ * @see Template
27
+ * @see TrueTemplate
28
+ * @see TrueOrTemplateOrObject
29
+ * @see TemplateOrBoolean
30
+ */
31
+ export type TemplateOrTrue<T extends true = true, > = | T | `${T}`
package/src/boolean.ts ADDED
@@ -0,0 +1,45 @@
1
+ /*******************************************************************************
2
+ Copyright (c) 2023-2024. Jonathan Bédard ~ JóôòKiwi
3
+
4
+ This project is free to use.
5
+ All the right is reserved to the author of this project.
6
+ ******************************************************************************/
7
+
8
+ /**
9
+ * A type-alias for a {@link Boolean}
10
+ * in a {@link String} template
11
+ *
12
+ * @see Template
13
+ * @see TrueTemplate
14
+ * @see FalseTemplate
15
+ */
16
+ export type BooleanTemplate<T extends boolean = boolean, > = `${T}`
17
+
18
+ /**
19
+ * A type-alias for a {@link Boolean}
20
+ * as a primitive or in a {@link String} template
21
+ *
22
+ * @see Template
23
+ * @see TemplateOrTrue
24
+ * @see TemplateOrFalse
25
+ * @see TemplateOrBooleanOrObject
26
+ */
27
+ export type TemplateOrBoolean<T extends boolean = boolean, > = | T | `${T}`
28
+
29
+ /**
30
+ * A type-alias for a {@link Boolean}
31
+ * as a primitive or an object
32
+ *
33
+ * @see TemplateOrBooleanOrObject
34
+ */
35
+ export type BooleanOrObject<T extends boolean = boolean, > = | T | Boolean
36
+
37
+ /**
38
+ * A type-alias for a {@link Boolean}
39
+ * as a primitive, an object or in a {@link String} template
40
+ *
41
+ * @see Template
42
+ * @see BooleanOrObject
43
+ * @see TemplateOrBoolean
44
+ */
45
+ export type TemplateOrBooleanOrObject<T extends boolean = boolean, > = | T | `${T}` | Boolean
package/src/empty.ts ADDED
@@ -0,0 +1,57 @@
1
+ /*******************************************************************************
2
+ Copyright (c) 2023-2024. Jonathan Bédard ~ JóôòKiwi
3
+
4
+ This project is free to use.
5
+ All the right is reserved to the author of this project.
6
+ ******************************************************************************/
7
+
8
+ /** A type-alias for an empty {@link String} */
9
+ export type EmptyString = ""
10
+
11
+ /**
12
+ * A type-alias for an empty {@link ReadonlyArray Array}
13
+ *
14
+ * @see EmptyMutableArray
15
+ */
16
+ export type EmptyArray = readonly []
17
+ /**
18
+ * A type-alias for an empty {@link Array MutableArray}
19
+ *
20
+ * @see EmptyArray
21
+ */
22
+ export type EmptyMutableArray = []
23
+
24
+ /** A type-alias for an empty {@link ReadonlySet Set} */
25
+ export type EmptySet = ReadonlySet<never>
26
+
27
+ /** A type-alias for an empty {@link WeakSet} */
28
+ export type EmptyWeakSet = Readonly<WeakSet<WeakKey>>
29
+
30
+ /**
31
+ * A type-alias for an empty {@link ReadonlyMap Map}
32
+ *
33
+ * @see EmptyMutableMap
34
+ */
35
+ export type EmptyMap = ReadonlyMap<any, never>
36
+ /**
37
+ * A type-alias for an empty {@link Map MutableMap}
38
+ *
39
+ * @see EmptyMap
40
+ */
41
+ export type EmptyMutableMap = Map<any, never>
42
+
43
+ /** A type-alias for an empty {@link WeakMap} */
44
+ export type EmptyWeakMap = Readonly<WeakMap<WeakKey, never>>
45
+
46
+ /**
47
+ * A type-alias for an empty {@link Object}
48
+ *
49
+ * @see EmptyMutableObject
50
+ */
51
+ export type EmptyObject = Readonly<{}>
52
+ /**
53
+ * A type-alias for an empty {@link Object} (that can be modified)
54
+ *
55
+ * @see EmptyObject
56
+ */
57
+ export type EmptyMutableObject = {}
package/src/index.ts ADDED
@@ -0,0 +1,23 @@
1
+ /*******************************************************************************
2
+ Copyright (c) 2023-2024. Jonathan Bédard ~ JóôòKiwi
3
+
4
+ This project is free to use.
5
+ All the right is reserved to the author of this project.
6
+ ******************************************************************************/
7
+
8
+ export type * from "./boolean"
9
+ export type * from "./boolean (false)"
10
+ export type * from "./boolean (true)"
11
+ export type * from "./empty"
12
+ export type * from "./mixed"
13
+ export type * from "./nullable"
14
+ export type * from "./numeric"
15
+ export type * from "./numeric (0)"
16
+ export type * from "./numeric (1)"
17
+ export type * from "./numeric (2)"
18
+ export type * from "./numeric (-1)"
19
+ export type * from "./numeric (bigint)"
20
+ export type * from "./numeric (number)"
21
+ export type * from "./string"
22
+ export type * from "./string (individual)"
23
+ export type * from "./symbol"