@oliversalzburg/js-utils 0.0.4 → 0.0.5

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 (91) hide show
  1. package/coverage/base.css +224 -0
  2. package/coverage/block-navigation.js +87 -0
  3. package/coverage/bundle.js +30 -0
  4. package/coverage/favicon.png +0 -0
  5. package/coverage/index.html +16 -0
  6. package/coverage/prettify.css +1 -0
  7. package/coverage/prettify.js +2 -0
  8. package/coverage/sort-arrow-sprite.png +0 -0
  9. package/coverage/sorter.js +196 -0
  10. package/coverage/spa.css +298 -0
  11. package/coverage/string-formatter.ts.html +187 -0
  12. package/coverage/tmp/coverage-4186-1699218521999-0.json +1 -0
  13. package/coverage/tmp/coverage-4196-1699218521967-0.json +1 -0
  14. package/docs/README.md +3 -0
  15. package/docs/classes/AbstractError.md +271 -0
  16. package/docs/classes/Canvas.md +177 -0
  17. package/docs/classes/InternalError.md +301 -0
  18. package/docs/classes/InvalidArgumentError.md +277 -0
  19. package/docs/classes/InvalidOperationError.md +277 -0
  20. package/docs/classes/NotImplementedError.md +276 -0
  21. package/docs/classes/PermissionViolationError.md +277 -0
  22. package/docs/classes/Random.md +109 -0
  23. package/docs/classes/RenderLoop.md +49 -0
  24. package/docs/classes/ResourceConflictError.md +276 -0
  25. package/docs/classes/UnexpectedNilError.md +169 -0
  26. package/docs/classes/UnknownError.md +280 -0
  27. package/docs/classes/Vector2.md +79 -0
  28. package/docs/classes/Vector3.md +106 -0
  29. package/docs/modules.md +1313 -0
  30. package/mkdocs.yml +52 -0
  31. package/output/core.d.ts +18 -1
  32. package/output/core.js +1 -0
  33. package/output/core.js.map +1 -1
  34. package/output/error-serializer.d.ts +1 -1
  35. package/output/error-serializer.js +1 -1
  36. package/output/errors/AbstractError.d.ts +9 -1
  37. package/output/errors/AbstractError.js +10 -2
  38. package/output/errors/AbstractError.js.map +1 -1
  39. package/output/errors/InternalError.d.ts +6 -1
  40. package/output/errors/InternalError.js +6 -1
  41. package/output/errors/InternalError.js.map +1 -1
  42. package/output/errors/InvalidArgumentError.d.ts +1 -1
  43. package/output/errors/InvalidArgumentError.js +1 -1
  44. package/output/errors/InvalidOperationError.d.ts +1 -1
  45. package/output/errors/InvalidOperationError.js +1 -1
  46. package/output/errors/NotImplementedError.d.ts +1 -1
  47. package/output/errors/NotImplementedError.js +1 -1
  48. package/output/errors/PermissionViolationError.d.ts +1 -1
  49. package/output/errors/PermissionViolationError.js +1 -1
  50. package/output/errors/ResourceConflictError.d.ts +1 -1
  51. package/output/errors/ResourceConflictError.js +1 -1
  52. package/output/errors/UnknownError.d.ts +2 -2
  53. package/output/errors/UnknownError.js +2 -2
  54. package/output/graphics/canvas.d.ts +80 -0
  55. package/output/graphics/canvas.js +164 -0
  56. package/output/graphics/canvas.js.map +1 -0
  57. package/output/graphics/core.d.ts +94 -0
  58. package/output/graphics/core.js +479 -0
  59. package/output/graphics/core.js.map +1 -0
  60. package/output/graphics/index.d.ts +3 -0
  61. package/output/graphics/index.js +4 -0
  62. package/output/graphics/index.js.map +1 -0
  63. package/output/graphics/render-loop.d.ts +20 -0
  64. package/output/graphics/render-loop.js +51 -0
  65. package/output/graphics/render-loop.js.map +1 -0
  66. package/output/index.d.ts +4 -0
  67. package/output/index.js +4 -0
  68. package/output/index.js.map +1 -1
  69. package/output/math/core.d.ts +46 -0
  70. package/output/math/core.js +72 -0
  71. package/output/math/core.js.map +1 -0
  72. package/output/math/index.d.ts +2 -0
  73. package/output/math/index.js +3 -0
  74. package/output/math/index.js.map +1 -0
  75. package/output/math/vector.d.ts +33 -0
  76. package/output/math/vector.js +42 -0
  77. package/output/math/vector.js.map +1 -0
  78. package/output/nil.d.ts +13 -8
  79. package/output/nil.js +16 -11
  80. package/output/nil.js.map +1 -1
  81. package/output/random.d.ts +56 -0
  82. package/output/random.js +184 -0
  83. package/output/random.js.map +1 -0
  84. package/output/string-formatter.test.d.ts +1 -0
  85. package/output/string-formatter.test.js +17 -0
  86. package/output/string-formatter.test.js.map +1 -0
  87. package/output/vector.d.ts +10 -0
  88. package/output/vector.js +19 -0
  89. package/output/vector.js.map +1 -0
  90. package/package.json +23 -8
  91. package/typedoc.json +8 -0
package/mkdocs.yml ADDED
@@ -0,0 +1,52 @@
1
+ copyright: Oliver Salzburg
2
+ dev_addr: 0.0.0.0:8000
3
+ docs_dir: docs
4
+ extra:
5
+ social:
6
+ - icon: fontawesome/brands/github
7
+ link: https://github.com/oliversalzburg/
8
+ markdown_extensions:
9
+ - abbr
10
+ - admonition
11
+ - pymdownx.details
12
+ - pymdownx.highlight:
13
+ anchor_linenums: true
14
+ - pymdownx.inlinehilite
15
+ - pymdownx.snippets
16
+ - pymdownx.superfences:
17
+ - pymdownx.tabbed:
18
+ alternate_style: true
19
+ - pymdownx.tilde
20
+ - toc:
21
+ permalink: true
22
+ plugins:
23
+ - search
24
+ repo_name: oliversalzburg/js-utils
25
+ repo_url: https://github.com/oliversalzburg/js-utils
26
+ site_name: JS Utils
27
+ theme:
28
+ favicon: assets/images/favicon.ico
29
+ features:
30
+ - content.code.copy
31
+ - navigation.instant
32
+ - navigation.sections
33
+ - navigation.tabs
34
+ - navigation.tabs.sticky
35
+ icon:
36
+ repo: fontawesome/brands/github
37
+ name: material
38
+ palette:
39
+ - media: "(prefers-color-scheme: light)"
40
+ scheme: default
41
+ accent: amber
42
+ primary: indigo
43
+ toggle:
44
+ icon: material/toggle-switch-off-outline
45
+ name: Switch to dark mode
46
+ - media: "(prefers-color-scheme: dark)"
47
+ scheme: slate
48
+ accent: indigo
49
+ primary: amber
50
+ toggle:
51
+ icon: material/toggle-switch
52
+ name: Switch to light mode
package/output/core.d.ts CHANGED
@@ -1,4 +1,21 @@
1
1
  /**
2
2
  * Describes a function that is a constructor for T.
3
3
  */
4
- export type ConstructorOf<T = Record<string, unknown>> = new (...args: any[]) => T;
4
+ export type ConstructorOf<T = Record<string, unknown>> = new (...args: Array<any>) => T;
5
+ /**
6
+ * Describes literally any function.
7
+ */
8
+ export type AnyFunction = (...args: Array<any>) => any;
9
+ /**
10
+ * Any constructor
11
+ */
12
+ export type AnyConstructor = new (...args: Array<any>) => any;
13
+ /**
14
+ * Describes a function returning an instance of T.
15
+ */
16
+ export type FunctionReturning<T = any> = (...args: Array<any>) => T;
17
+ /**
18
+ * Describes a class "mixin", which is a function that returns a dynamically
19
+ * constructed class, based on the passed parameters.
20
+ */
21
+ export type Mixin<T extends FunctionReturning> = InstanceType<ReturnType<T>>;
package/output/core.js CHANGED
@@ -1,2 +1,3 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  export {};
2
3
  //# sourceMappingURL=core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../source/core.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../source/core.ts"],"names":[],"mappings":"AAAA,uDAAuD"}
@@ -6,7 +6,7 @@ export type SerializedError = Record<string, Record<string, string> | string | u
6
6
  /**
7
7
  * Determine if the given unknown subject is an `Error` instance.
8
8
  * @param subject The object to inspect.
9
- * @returns `true` if the subject is an `Error`, `false´ otherwise.
9
+ * @returns `true` if the subject is an `Error`, `false` otherwise.
10
10
  */
11
11
  export declare const isError: (subject: unknown) => subject is Error;
12
12
  /**
@@ -5,7 +5,7 @@ import { UnknownError } from "./errors/UnknownError.js";
5
5
  /**
6
6
  * Determine if the given unknown subject is an `Error` instance.
7
7
  * @param subject The object to inspect.
8
- * @returns `true` if the subject is an `Error`, `false´ otherwise.
8
+ * @returns `true` if the subject is an `Error`, `false` otherwise.
9
9
  */
10
10
  export const isError = (subject) => {
11
11
  return subject instanceof Error || types.isNativeError(subject);
@@ -24,11 +24,19 @@ export declare class AbstractError extends Error {
24
24
  */
25
25
  code: string;
26
26
  /**
27
- * Constructs a new AbstractError.
27
+ * Constructs a new {@link AbstractError}.
28
28
  * @param code The main identification code for the error.
29
29
  * @param message The main error message.
30
30
  * @param status The HTTP status code to return.
31
31
  */
32
32
  constructor(code: string, message: string, status: number);
33
+ /**
34
+ * Checks if an object is an instance of {@link AbstractError}, or one of its subclasses.
35
+ * @param error The object to check.
36
+ * @param allowForeignModule Only check for similar looking error codes.
37
+ * You're going to want to use this if you're dealing with a setup where
38
+ * multiple versions of js-utils are loaded.
39
+ * @returns `true` if the object is an {@link AbstractError}, `false` otherwise.
40
+ */
33
41
  static isAbstractError(error: unknown, allowForeignModule?: boolean): error is AbstractError;
34
42
  }
@@ -23,7 +23,7 @@ export class AbstractError extends Error {
23
23
  */
24
24
  code;
25
25
  /**
26
- * Constructs a new AbstractError.
26
+ * Constructs a new {@link AbstractError}.
27
27
  * @param code The main identification code for the error.
28
28
  * @param message The main error message.
29
29
  * @param status The HTTP status code to return.
@@ -38,11 +38,19 @@ export class AbstractError extends Error {
38
38
  // location we're actually interested in.
39
39
  Error.captureStackTrace(this, AbstractError);
40
40
  }
41
+ /**
42
+ * Checks if an object is an instance of {@link AbstractError}, or one of its subclasses.
43
+ * @param error The object to check.
44
+ * @param allowForeignModule Only check for similar looking error codes.
45
+ * You're going to want to use this if you're dealing with a setup where
46
+ * multiple versions of js-utils are loaded.
47
+ * @returns `true` if the object is an {@link AbstractError}, `false` otherwise.
48
+ */
41
49
  static isAbstractError(error, allowForeignModule = true) {
42
50
  if (error instanceof AbstractError) {
43
51
  return true;
44
52
  }
45
- // When multiple versions of core-models3 are loaded at runtime, the
53
+ // When multiple versions of js-utils are loaded at runtime, the
46
54
  // prototypes of errors don't align. In that case, we just analyze the
47
55
  // error code.
48
56
  if (allowForeignModule) {
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractError.js","sourceRoot":"","sources":["../../source/errors/AbstractError.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC;;;;OAIG;IACH,MAAM,CAAS;IAEf;;;OAGG;IACH,KAAK,CAAe;IAEpB;;;OAGG;IACH,IAAI,CAAgB;IAEpB;;OAEG;IACH,IAAI,CAAS;IAEb;;;;;OAKG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,MAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,qGAAqG;QACrG,yCAAyC;QACzC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,KAAc,EAAE,kBAAkB,GAAG,IAAI;QAC9D,IAAI,KAAK,YAAY,aAAa,EAAE;YAClC,OAAO,IAAI,CAAC;SACb;QAED,oEAAoE;QACpE,sEAAsE;QACtE,cAAc;QACd,IAAI,kBAAkB,EAAE;YACtB,MAAM,WAAW,GAAG,KAAgC,CAAC;YACrD,IACE,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK;gBACvB,MAAM,IAAI,WAAW;gBACrB,OAAO,WAAW,CAAC,IAAI,KAAK,QAAQ,EACpC;gBACA,MAAM,UAAU,GAAG,KAAyB,CAAC;gBAC7C,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;oBACrC,OAAO,IAAI,CAAC;iBACb;aACF;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
1
+ {"version":3,"file":"AbstractError.js","sourceRoot":"","sources":["../../source/errors/AbstractError.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC;;;;OAIG;IACH,MAAM,CAAS;IAEf;;;OAGG;IACH,KAAK,CAAe;IAEpB;;;OAGG;IACH,IAAI,CAAgB;IAEpB;;OAEG;IACH,IAAI,CAAS;IAEb;;;;;OAKG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,MAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,qGAAqG;QACrG,yCAAyC;QACzC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,eAAe,CAAC,KAAc,EAAE,kBAAkB,GAAG,IAAI;QAC9D,IAAI,KAAK,YAAY,aAAa,EAAE;YAClC,OAAO,IAAI,CAAC;SACb;QAED,gEAAgE;QAChE,sEAAsE;QACtE,cAAc;QACd,IAAI,kBAAkB,EAAE;YACtB,MAAM,WAAW,GAAG,KAAgC,CAAC;YACrD,IACE,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK;gBACvB,MAAM,IAAI,WAAW;gBACrB,OAAO,WAAW,CAAC,IAAI,KAAK,QAAQ,EACpC;gBACA,MAAM,UAAU,GAAG,KAAyB,CAAC;gBAC7C,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;oBACrC,OAAO,IAAI,CAAC;iBACb;aACF;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -5,10 +5,15 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export declare class InternalError extends AbstractError {
7
7
  /**
8
- * Constructs a new `InternalError`.
8
+ * Constructs a new {@link InternalError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
12
12
  constructor(message: string, status?: number);
13
+ /**
14
+ * Converts an error into an {@link InternalError}.
15
+ * @param error The error to convert.
16
+ * @returns An {@link InternalError} that represents the given error.
17
+ */
13
18
  static fromError(error: Error): InternalError;
14
19
  }
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export class InternalError extends AbstractError {
7
7
  /**
8
- * Constructs a new `InternalError`.
8
+ * Constructs a new {@link InternalError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -16,6 +16,11 @@ export class InternalError extends AbstractError {
16
16
  // constructor instead of the code location we're actually interested in.
17
17
  Error.captureStackTrace(this, InternalError);
18
18
  }
19
+ /**
20
+ * Converts an error into an {@link InternalError}.
21
+ * @param error The error to convert.
22
+ * @returns An {@link InternalError} that represents the given error.
23
+ */
19
24
  static fromError(error) {
20
25
  // Create a _real_ `InternalError` instance, which we will return later.
21
26
  const internalError = new InternalError(error.message);
@@ -1 +1 @@
1
- {"version":3,"file":"InternalError.js","sourceRoot":"","sources":["../../source/errors/InternalError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC9C;;;;OAIG;IACH,YAAY,OAAe,EAAE,MAAM,GAAG,GAAG;QACvC,KAAK,CAAC,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAE1C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAE5B,qEAAqE;QACrE,yEAAyE;QACzE,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,KAAY;QAC3B,wEAAwE;QACxE,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvD,kEAAkE;QAClE,mEAAmE;QACnE,0BAA0B;QAC1B,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACtE,uBAAuB;QACvB,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;QAC5B,0CAA0C;QAC1C,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
1
+ {"version":3,"file":"InternalError.js","sourceRoot":"","sources":["../../source/errors/InternalError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC9C;;;;OAIG;IACH,YAAY,OAAe,EAAE,MAAM,GAAG,GAAG;QACvC,KAAK,CAAC,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAE1C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAE5B,qEAAqE;QACrE,yEAAyE;QACzE,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,KAAY;QAC3B,wEAAwE;QACxE,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvD,kEAAkE;QAClE,mEAAmE;QACnE,0BAA0B;QAC1B,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACtE,uBAAuB;QACvB,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;QAC5B,0CAA0C;QAC1C,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,OAAO,aAAa,CAAC;IACvB,CAAC;CACF"}
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export declare class InvalidArgumentError extends AbstractError {
7
7
  /**
8
- * Constructs a new `InvalidArgumentError`.
8
+ * Constructs a new {@link InvalidArgumentError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export class InvalidArgumentError extends AbstractError {
7
7
  /**
8
- * Constructs a new `InvalidArgumentError`.
8
+ * Constructs a new {@link InvalidArgumentError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export declare class InvalidOperationError extends AbstractError {
7
7
  /**
8
- * Constructs a new `InvalidOperationError`.
8
+ * Constructs a new {@link InvalidOperationError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export class InvalidOperationError extends AbstractError {
7
7
  /**
8
- * Constructs a new `InvalidOperationError`.
8
+ * Constructs a new {@link InvalidOperationError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -4,7 +4,7 @@ import { AbstractError } from "./AbstractError.js";
4
4
  */
5
5
  export declare class NotImplementedError extends AbstractError {
6
6
  /**
7
- * Constructs a new `NotImplementedError`.
7
+ * Constructs a new {@link NotImplementedError}.
8
8
  * @param message The main error message.
9
9
  * @param status The HTTP status code to return.
10
10
  */
@@ -4,7 +4,7 @@ import { AbstractError } from "./AbstractError.js";
4
4
  */
5
5
  export class NotImplementedError extends AbstractError {
6
6
  /**
7
- * Constructs a new `NotImplementedError`.
7
+ * Constructs a new {@link NotImplementedError}.
8
8
  * @param message The main error message.
9
9
  * @param status The HTTP status code to return.
10
10
  */
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export declare class PermissionViolationError extends AbstractError {
7
7
  /**
8
- * Constructs a new `PermissionViolationError`.
8
+ * Constructs a new {@link PermissionViolationError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -5,7 +5,7 @@ import { AbstractError } from "./AbstractError.js";
5
5
  */
6
6
  export class PermissionViolationError extends AbstractError {
7
7
  /**
8
- * Constructs a new `PermissionViolationError`.
8
+ * Constructs a new {@link PermissionViolationError}.
9
9
  * @param message The main error message.
10
10
  * @param status The HTTP status code to return.
11
11
  */
@@ -4,7 +4,7 @@ import { AbstractError } from "./AbstractError.js";
4
4
  */
5
5
  export declare class ResourceConflictError extends AbstractError {
6
6
  /**
7
- * Constructs a new `ResourceConflictError`.
7
+ * Constructs a new {@link ResourceConflictError}.
8
8
  * @param message The main error message.
9
9
  * @param status The HTTP status code to return.
10
10
  */
@@ -4,7 +4,7 @@ import { AbstractError } from "./AbstractError.js";
4
4
  */
5
5
  export class ResourceConflictError extends AbstractError {
6
6
  /**
7
- * Constructs a new `ResourceConflictError`.
7
+ * Constructs a new {@link ResourceConflictError}.
8
8
  * @param message The main error message.
9
9
  * @param status The HTTP status code to return.
10
10
  */
@@ -4,11 +4,11 @@ import { AbstractError } from "./AbstractError.js";
4
4
  * real `Error` instance.
5
5
  * Like when you catch a `throw "boom"`, we will convert the caught `"boom"`
6
6
  * into an `UnknownError`.
7
- * To enrich an `Error`-like object that was caught, use the `InternalError`.
7
+ * To enrich an `Error`-like object that was caught, use the {@link InternalError}.
8
8
  */
9
9
  export declare class UnknownError extends AbstractError {
10
10
  /**
11
- * Constructs a new `UnknownError`.
11
+ * Constructs a new {@link UnknownError}.
12
12
  * @param message The main error message.
13
13
  * @param status The HTTP status code to return.
14
14
  */
@@ -4,11 +4,11 @@ import { AbstractError } from "./AbstractError.js";
4
4
  * real `Error` instance.
5
5
  * Like when you catch a `throw "boom"`, we will convert the caught `"boom"`
6
6
  * into an `UnknownError`.
7
- * To enrich an `Error`-like object that was caught, use the `InternalError`.
7
+ * To enrich an `Error`-like object that was caught, use the {@link InternalError}.
8
8
  */
9
9
  export class UnknownError extends AbstractError {
10
10
  /**
11
- * Constructs a new `UnknownError`.
11
+ * Constructs a new {@link UnknownError}.
12
12
  * @param message The main error message.
13
13
  * @param status The HTTP status code to return.
14
14
  */
@@ -0,0 +1,80 @@
1
+ /// <reference types="@types/web" />
2
+ /**
3
+ * A wrapper around {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement HTMLCanvasElement}
4
+ * to provide some convience for double-buffered drawing.
5
+ */
6
+ export declare class Canvas {
7
+ readonly canvas: HTMLCanvasElement;
8
+ readonly width: number;
9
+ readonly height: number;
10
+ readonly context: CanvasRenderingContext2D;
11
+ readonly pixMap: ImageData;
12
+ readonly buffer: Uint8ClampedArray;
13
+ /**
14
+ * Constructs a new {@link Canvas}.
15
+ * @param canvas The canvas to wrap.
16
+ * @param width The width of the canvas.
17
+ * @param height The height of the canvas.
18
+ */
19
+ constructor(canvas: HTMLCanvasElement, width: number, height: number);
20
+ /**
21
+ * Draws the backbuffer onto the canvas.
22
+ */
23
+ update(): void;
24
+ /**
25
+ * Returns the color of a pixel in the backbuffer.
26
+ * @param x The X coordinate to retrieve.
27
+ * @param y The X coordinate to retrieve.
28
+ * @returns The color of the pixel at the given local.
29
+ */
30
+ getPixel32(x: number, y: number): number;
31
+ /**
32
+ * Colors a pixel in the backbuffer.
33
+ * @param x The X coordinate to color.
34
+ * @param y The Y coordinate to color.
35
+ * @param color The color to place at the coordinate.
36
+ */
37
+ setPixel32(x: number, y: number, color: number): void;
38
+ /**
39
+ * Fills the entire backbuffer with the given color.
40
+ * @param color The color to fill the backbuffer with.
41
+ */
42
+ clearWith(color: number): void;
43
+ }
44
+ /**
45
+ * Linearly blends a new pixel with an existing color value in a {@link Canvas}.
46
+ * @param canvas The {@link Canvas} to interact with.
47
+ * @param x The X coordinate at which to place the pixel.
48
+ * @param y The Y coordinate at which to place the pixel.
49
+ * @param color The color of the pixel.
50
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
51
+ */
52
+ export declare const putPixel32: (canvas: Canvas, x: number, y: number, color: number, alpha: number) => void;
53
+ /**
54
+ * Additively blends a new pixel with an existing color value in a {@link Canvas}.
55
+ * @param canvas The {@link Canvas} to interact with.
56
+ * @param x The X coordinate at which to place the pixel.
57
+ * @param y The Y coordinate at which to place the pixel.
58
+ * @param color The color of the pixel.
59
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
60
+ */
61
+ export declare const putPixel32Add: (canvas: Canvas, x: number, y: number, color: number, alpha: number) => void;
62
+ /**
63
+ * Subtractively blends a new pixel with an existing color value in a {@link Canvas}.
64
+ * @param canvas The {@link Canvas} to interact with.
65
+ * @param x The X coordinate at which to place the pixel.
66
+ * @param y The Y coordinate at which to place the pixel.
67
+ * @param color The color of the pixel.
68
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
69
+ */
70
+ export declare const putPixel32Sub: (canvas: Canvas, x: number, y: number, color: number, alpha: number) => void;
71
+ /**
72
+ * Linearly blends a new pixel with an existing color value in a {@link Canvas}.
73
+ * Compared to {@link putPixel32}, this function supports sub-pixel placement, but is dramatically slower.
74
+ * @param canvas The {@link Canvas} to interact with.
75
+ * @param x The X coordinate at which to place the pixel.
76
+ * @param y The Y coordinate at which to place the pixel.
77
+ * @param color The color of the pixel.
78
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
79
+ */
80
+ export declare const putSubPixel32: (canvas: Canvas, x: number, y: number, color: number, alpha: number) => void;
@@ -0,0 +1,164 @@
1
+ import { mustExist } from "../nil.js";
2
+ import { blend, blendAdditive, blendSubtractive, fromRGBA, getA, getB, getG, getR, } from "./core.js";
3
+ /**
4
+ * A wrapper around {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement HTMLCanvasElement}
5
+ * to provide some convience for double-buffered drawing.
6
+ */
7
+ export class Canvas {
8
+ canvas;
9
+ width;
10
+ height;
11
+ context;
12
+ pixMap;
13
+ buffer;
14
+ /**
15
+ * Constructs a new {@link Canvas}.
16
+ * @param canvas The canvas to wrap.
17
+ * @param width The width of the canvas.
18
+ * @param height The height of the canvas.
19
+ */
20
+ constructor(canvas, width, height) {
21
+ this.canvas = canvas;
22
+ this.width = width;
23
+ this.height = height;
24
+ this.context = mustExist(this.canvas.getContext("2d"), "Unable to create rendering context.");
25
+ this.pixMap = this.context.createImageData(width, height);
26
+ this.buffer = this.pixMap.data;
27
+ this.context.font = "12px sans-serif";
28
+ }
29
+ /**
30
+ * Draws the backbuffer onto the canvas.
31
+ */
32
+ update() {
33
+ this.context.putImageData(this.pixMap, 0, 0);
34
+ }
35
+ /**
36
+ * Returns the color of a pixel in the backbuffer.
37
+ * @param x The X coordinate to retrieve.
38
+ * @param y The X coordinate to retrieve.
39
+ * @returns The color of the pixel at the given local.
40
+ */
41
+ getPixel32(x, y) {
42
+ const bufferOffset = Math.trunc((x + y * this.width) * 4);
43
+ return fromRGBA(this.buffer[bufferOffset + 0], this.buffer[bufferOffset + 1], this.buffer[bufferOffset + 2], this.buffer[bufferOffset + 3]);
44
+ }
45
+ /**
46
+ * Colors a pixel in the backbuffer.
47
+ * @param x The X coordinate to color.
48
+ * @param y The Y coordinate to color.
49
+ * @param color The color to place at the coordinate.
50
+ */
51
+ setPixel32(x, y, color) {
52
+ const bufferOffset = Math.trunc((x + y * this.width) * 4);
53
+ this.buffer[bufferOffset + 0] = getR(color);
54
+ this.buffer[bufferOffset + 1] = getG(color);
55
+ this.buffer[bufferOffset + 2] = getB(color);
56
+ this.buffer[bufferOffset + 3] = getA(color);
57
+ }
58
+ /**
59
+ * Fills the entire backbuffer with the given color.
60
+ * @param color The color to fill the backbuffer with.
61
+ */
62
+ clearWith(color) {
63
+ const r = getR(color);
64
+ const g = getG(color);
65
+ const b = getB(color);
66
+ const a = getA(color);
67
+ for (let bufferOffset = 0; bufferOffset < this.width * this.height * 4; bufferOffset += 4) {
68
+ this.buffer[bufferOffset + 0] = r;
69
+ this.buffer[bufferOffset + 1] = g;
70
+ this.buffer[bufferOffset + 2] = b;
71
+ this.buffer[bufferOffset + 3] = a;
72
+ }
73
+ }
74
+ }
75
+ /**
76
+ * Linearly blends a new pixel with an existing color value in a {@link Canvas}.
77
+ * @param canvas The {@link Canvas} to interact with.
78
+ * @param x The X coordinate at which to place the pixel.
79
+ * @param y The Y coordinate at which to place the pixel.
80
+ * @param color The color of the pixel.
81
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
82
+ */
83
+ export const putPixel32 = (canvas, x, y, color, alpha) => {
84
+ if (canvas.width < x || x < 0 || canvas.height < y || y < 0) {
85
+ return;
86
+ }
87
+ x = Math.trunc(x);
88
+ y = Math.trunc(y);
89
+ if (alpha > 255) {
90
+ alpha = 255;
91
+ }
92
+ const srcColor = canvas.getPixel32(x, y);
93
+ const newColor = blend(srcColor, color, alpha);
94
+ canvas.setPixel32(x, y, newColor);
95
+ };
96
+ /**
97
+ * Additively blends a new pixel with an existing color value in a {@link Canvas}.
98
+ * @param canvas The {@link Canvas} to interact with.
99
+ * @param x The X coordinate at which to place the pixel.
100
+ * @param y The Y coordinate at which to place the pixel.
101
+ * @param color The color of the pixel.
102
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
103
+ */
104
+ export const putPixel32Add = (canvas, x, y, color, alpha) => {
105
+ if (canvas.width < x || x < 0 || canvas.height < y || y < 0) {
106
+ return;
107
+ }
108
+ x = Math.round(x);
109
+ y = Math.round(y);
110
+ if (alpha > 255) {
111
+ alpha = 255;
112
+ }
113
+ const srcColor = canvas.getPixel32(x, y);
114
+ const newColor = blendAdditive(srcColor, color, alpha);
115
+ canvas.setPixel32(x, y, newColor);
116
+ };
117
+ /**
118
+ * Subtractively blends a new pixel with an existing color value in a {@link Canvas}.
119
+ * @param canvas The {@link Canvas} to interact with.
120
+ * @param x The X coordinate at which to place the pixel.
121
+ * @param y The Y coordinate at which to place the pixel.
122
+ * @param color The color of the pixel.
123
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
124
+ */
125
+ export const putPixel32Sub = (canvas, x, y, color, alpha) => {
126
+ if (canvas.width < x || x < 0 || canvas.height < y || y < 0) {
127
+ return;
128
+ }
129
+ x = Math.round(x);
130
+ y = Math.round(y);
131
+ if (alpha > 255) {
132
+ alpha = 255;
133
+ }
134
+ const srcColor = canvas.getPixel32(x, y);
135
+ const newColor = blendSubtractive(srcColor, color, alpha);
136
+ canvas.setPixel32(x, y, newColor);
137
+ };
138
+ /**
139
+ * Linearly blends a new pixel with an existing color value in a {@link Canvas}.
140
+ * Compared to {@link putPixel32}, this function supports sub-pixel placement, but is dramatically slower.
141
+ * @param canvas The {@link Canvas} to interact with.
142
+ * @param x The X coordinate at which to place the pixel.
143
+ * @param y The Y coordinate at which to place the pixel.
144
+ * @param color The color of the pixel.
145
+ * @param alpha The alpha value to use to blend the pixel with existing color at the location.
146
+ */
147
+ export const putSubPixel32 = (canvas, x, y, color, alpha) => {
148
+ if (canvas.width < x || x < 0 || canvas.height < y || y < 0) {
149
+ return;
150
+ }
151
+ const xweight = x - Math.trunc(x);
152
+ const yweight = y - Math.trunc(y);
153
+ const xweightn = 1 - xweight;
154
+ const yweightn = 1 - yweight;
155
+ const alpha0 = xweightn * yweightn * alpha;
156
+ const alpha1 = xweight * yweightn * alpha;
157
+ const alpha2 = xweightn * yweight * alpha;
158
+ const alpha3 = xweight * yweight * alpha;
159
+ putPixel32(canvas, x + 0, y + 0, color, alpha0);
160
+ putPixel32(canvas, x + 1, y + 0, color, alpha1);
161
+ putPixel32(canvas, x + 0, y + 1, color, alpha2);
162
+ putPixel32(canvas, x + 1, y + 1, color, alpha3);
163
+ };
164
+ //# sourceMappingURL=canvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvas.js","sourceRoot":"","sources":["../../source/graphics/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,GACL,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,OAAO,MAAM;IACR,MAAM,CAAoB;IAC1B,KAAK,CAAS;IACd,MAAM,CAAS;IACf,OAAO,CAA2B;IAClC,MAAM,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