com.sweaxizone.w3c.extension 1.0.5 → 1.0.6
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/README.md +0 -21
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,27 +39,6 @@ class MoreSpecializedPlayer extends MediaPlayer {
|
|
|
39
39
|
|
|
40
40
|
> Note that event types must implement the `Event` interface.
|
|
41
41
|
|
|
42
|
-
## Simple enumerations
|
|
43
|
-
|
|
44
|
-
This is backwards-compatible with `type` unions of string literals.
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
const ExampleEnum = Enum({
|
|
48
|
-
variantA: 0,
|
|
49
|
-
variantB: 1,
|
|
50
|
-
}, {
|
|
51
|
-
plus(e: ExampleEnum, inc: number): number {
|
|
52
|
-
return ExampleEnum.valueOf(e) + inc;
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
type ExampleEnum = Parameters<typeof ExampleEnum>[0];
|
|
56
|
-
|
|
57
|
-
const x: ExampleEnum = "variantA";
|
|
58
|
-
const y: string = ExampleEnum("variantB");
|
|
59
|
-
ExampleEnum.valueOf(x) // val: number
|
|
60
|
-
ExampleEnum.plus("variantA", 1) // 1
|
|
61
|
-
```
|
|
62
|
-
|
|
63
42
|
## Other additions
|
|
64
43
|
|
|
65
44
|
- `assert`
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "./Enum";
|
|
2
1
|
import "./E4X";
|
|
3
2
|
import "./SAEventTarget";
|
|
4
3
|
import "./SAByteArray";
|
|
@@ -47,20 +46,6 @@ declare global {
|
|
|
47
46
|
capture?: boolean;
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
|
-
declare global {
|
|
51
|
-
/**
|
|
52
|
-
* Simple enumerations with number-to-string mapping and vice-versa,
|
|
53
|
-
* as well as the ability to add documentation comments to
|
|
54
|
-
* variants.
|
|
55
|
-
*/
|
|
56
|
-
function Enum<K extends string, V extends number | bigint, UserMethods>(variants: Record<K, V>, methods?: UserMethods): EnumType<K, V, UserMethods>;
|
|
57
|
-
type EnumType<K, V, UserMethods> = {
|
|
58
|
-
(key: K): K;
|
|
59
|
-
from(arg: string | number | bigint): null | K;
|
|
60
|
-
valueOf(key: K): V;
|
|
61
|
-
variants(): K[];
|
|
62
|
-
} & (UserMethods extends object ? UserMethods : {});
|
|
63
|
-
}
|
|
64
49
|
declare global {
|
|
65
50
|
const trace: typeof console.log;
|
|
66
51
|
const etrace: typeof console.error;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
require("./Enum");
|
|
7
6
|
require("./E4X");
|
|
8
7
|
require("./SAEventTarget");
|
|
9
8
|
require("./SAByteArray");
|