@ac-kit/format-osc 0.0.0-stage → 0.1.1
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/CHANGELOG.md +40 -0
- package/LICENSE +28 -0
- package/README.md +132 -2
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +40 -0
- package/dist/errors.js.map +1 -0
- package/dist/framing/_decode-framed-packet.d.ts +9 -0
- package/dist/framing/_decode-framed-packet.d.ts.map +1 -0
- package/dist/framing/_decode-framed-packet.js +23 -0
- package/dist/framing/_decode-framed-packet.js.map +1 -0
- package/dist/framing/osc-datagram-codec.d.ts +17 -0
- package/dist/framing/osc-datagram-codec.d.ts.map +1 -0
- package/dist/framing/osc-datagram-codec.js +21 -0
- package/dist/framing/osc-datagram-codec.js.map +1 -0
- package/dist/framing/osc-datagram-decoder.d.ts +22 -0
- package/dist/framing/osc-datagram-decoder.d.ts.map +1 -0
- package/dist/framing/osc-datagram-decoder.js +26 -0
- package/dist/framing/osc-datagram-decoder.js.map +1 -0
- package/dist/framing/osc-datagram-encoder.d.ts +8 -0
- package/dist/framing/osc-datagram-encoder.d.ts.map +1 -0
- package/dist/framing/osc-datagram-encoder.js +9 -0
- package/dist/framing/osc-datagram-encoder.js.map +1 -0
- package/dist/framing/osc-size-prefixed-codec.d.ts +19 -0
- package/dist/framing/osc-size-prefixed-codec.d.ts.map +1 -0
- package/dist/framing/osc-size-prefixed-codec.js +23 -0
- package/dist/framing/osc-size-prefixed-codec.js.map +1 -0
- package/dist/framing/osc-size-prefixed-decoder.d.ts +40 -0
- package/dist/framing/osc-size-prefixed-decoder.d.ts.map +1 -0
- package/dist/framing/osc-size-prefixed-decoder.js +59 -0
- package/dist/framing/osc-size-prefixed-decoder.js.map +1 -0
- package/dist/framing/osc-size-prefixed-encoder.d.ts +10 -0
- package/dist/framing/osc-size-prefixed-encoder.d.ts.map +1 -0
- package/dist/framing/osc-size-prefixed-encoder.js +20 -0
- package/dist/framing/osc-size-prefixed-encoder.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/packet/_bundle-marker.d.ts +3 -0
- package/dist/packet/_bundle-marker.d.ts.map +1 -0
- package/dist/packet/_bundle-marker.js +3 -0
- package/dist/packet/_bundle-marker.js.map +1 -0
- package/dist/packet/_osc-writer.d.ts +31 -0
- package/dist/packet/_osc-writer.d.ts.map +1 -0
- package/dist/packet/_osc-writer.js +72 -0
- package/dist/packet/_osc-writer.js.map +1 -0
- package/dist/packet/_read-osc-packet.d.ts +19 -0
- package/dist/packet/_read-osc-packet.d.ts.map +1 -0
- package/dist/packet/_read-osc-packet.js +290 -0
- package/dist/packet/_read-osc-packet.js.map +1 -0
- package/dist/packet/_write-osc-packet.d.ts +12 -0
- package/dist/packet/_write-osc-packet.d.ts.map +1 -0
- package/dist/packet/_write-osc-packet.js +155 -0
- package/dist/packet/_write-osc-packet.js.map +1 -0
- package/dist/packet/decode-osc-packet.d.ts +48 -0
- package/dist/packet/decode-osc-packet.d.ts.map +1 -0
- package/dist/packet/decode-osc-packet.js +39 -0
- package/dist/packet/decode-osc-packet.js.map +1 -0
- package/dist/packet/encode-osc-packet.d.ts +32 -0
- package/dist/packet/encode-osc-packet.d.ts.map +1 -0
- package/dist/packet/encode-osc-packet.js +37 -0
- package/dist/packet/encode-osc-packet.js.map +1 -0
- package/dist/packet/osc-packet.d.ts +104 -0
- package/dist/packet/osc-packet.d.ts.map +1 -0
- package/dist/packet/osc-packet.js +2 -0
- package/dist/packet/osc-packet.js.map +1 -0
- package/dist/time-tag/_ntp.d.ts +13 -0
- package/dist/time-tag/_ntp.d.ts.map +1 -0
- package/dist/time-tag/_ntp.js +19 -0
- package/dist/time-tag/_ntp.js.map +1 -0
- package/dist/time-tag/osc-time-tag-from-date.d.ts +29 -0
- package/dist/time-tag/osc-time-tag-from-date.d.ts.map +1 -0
- package/dist/time-tag/osc-time-tag-from-date.js +48 -0
- package/dist/time-tag/osc-time-tag-from-date.js.map +1 -0
- package/dist/time-tag/osc-time-tag-to-date.d.ts +21 -0
- package/dist/time-tag/osc-time-tag-to-date.d.ts.map +1 -0
- package/dist/time-tag/osc-time-tag-to-date.js +26 -0
- package/dist/time-tag/osc-time-tag-to-date.js.map +1 -0
- package/dist/time-tag/osc-time-tag.d.ts +29 -0
- package/dist/time-tag/osc-time-tag.d.ts.map +1 -0
- package/dist/time-tag/osc-time-tag.js +16 -0
- package/dist/time-tag/osc-time-tag.js.map +1 -0
- package/package.json +60 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An OSC time tag: a 64-bit NTP timestamp (RFC 5905 §6), the instant a bundle's
|
|
3
|
+
* contents take effect.
|
|
4
|
+
*
|
|
5
|
+
* `seconds` counts from the NTP prime epoch, 1900-01-01T00:00:00Z, modulo 2^32;
|
|
6
|
+
* `fraction` is the fraction of a second in units of 2^-32 s (about 233
|
|
7
|
+
* picoseconds). Both are unsigned 32-bit integers.
|
|
8
|
+
*
|
|
9
|
+
* {@link OSC_TIME_TAG_IMMEDIATELY} is not an instant but a request to act on
|
|
10
|
+
* receipt; {@link oscTimeTagFromDate} and {@link oscTimeTagToDate} convert the
|
|
11
|
+
* others.
|
|
12
|
+
*/
|
|
13
|
+
export type OscTimeTag = {
|
|
14
|
+
/** Whole seconds since 1900-01-01T00:00:00Z, modulo 2^32; 0 to 2^32 − 1. */
|
|
15
|
+
seconds: number;
|
|
16
|
+
/** Fraction of a second, in units of 2^-32 s; 0 to 2^32 − 1. */
|
|
17
|
+
fraction: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The time tag meaning "immediately": 63 zero bits followed by a one, as OSC
|
|
21
|
+
* 1.0 reserves it. A bundle carrying it is dispatched on receipt.
|
|
22
|
+
*/
|
|
23
|
+
export declare const OSC_TIME_TAG_IMMEDIATELY: Readonly<OscTimeTag>;
|
|
24
|
+
/**
|
|
25
|
+
* Whether `tag` is {@link OSC_TIME_TAG_IMMEDIATELY}. Check it before
|
|
26
|
+
* {@link oscTimeTagToDate}, which would read it as an instant in 2036.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isOscTimeTagImmediately(tag: OscTimeTag): boolean;
|
|
29
|
+
//# sourceMappingURL=osc-time-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osc-time-tag.d.ts","sourceRoot":"","sources":["../../src/time-tag/osc-time-tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,UAAU,CAGxD,CAAC;AAEH;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The time tag meaning "immediately": 63 zero bits followed by a one, as OSC
|
|
3
|
+
* 1.0 reserves it. A bundle carrying it is dispatched on receipt.
|
|
4
|
+
*/
|
|
5
|
+
export const OSC_TIME_TAG_IMMEDIATELY = Object.freeze({
|
|
6
|
+
seconds: 0,
|
|
7
|
+
fraction: 1,
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Whether `tag` is {@link OSC_TIME_TAG_IMMEDIATELY}. Check it before
|
|
11
|
+
* {@link oscTimeTagToDate}, which would read it as an instant in 2036.
|
|
12
|
+
*/
|
|
13
|
+
export function isOscTimeTagImmediately(tag) {
|
|
14
|
+
return tag.seconds === 0 && tag.fraction === 1;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=osc-time-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osc-time-tag.js","sourceRoot":"","sources":["../../src/time-tag/osc-time-tag.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC3E,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;CACX,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAe;IACtD,OAAO,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/format-osc",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Open Sound Control 1.0 with the OSC 1.1 additions: the packet model, whole-packet encode/decode, NTP time tags, and datagram and size-prefixed stream codecs.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ntp-time-tag",
|
|
7
|
+
"open-sound-control",
|
|
8
|
+
"osc",
|
|
9
|
+
"osc-bundle"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://anthochamp.github.io/node-essentials/api/format-osc/",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "BSD-3-Clause",
|
|
16
|
+
"author": "Anthony Champagne <dev@anthonychampagne.fr>",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
|
|
20
|
+
"directory": "packages/format-osc"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"main": "./dist/index.js",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"compile": "tsc -p ./tsconfig.build.json -outDir dist",
|
|
40
|
+
"compile:check": "tsc -noEmit -p ./tsconfig.json",
|
|
41
|
+
"clean": "rimraf dist",
|
|
42
|
+
"build": "yarn clean && yarn compile",
|
|
43
|
+
"test": "yarn run -T vitest run",
|
|
44
|
+
"prepack": "yarn build"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@ac-kit/core": "^0.4.0",
|
|
48
|
+
"@ac-kit/format-core": "^0.1.4",
|
|
49
|
+
"@types/web": "^0.0.359"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@ac-kit/tsconfig": "0.1.0",
|
|
53
|
+
"@ac-kit/typedoc-config": "0.1.0",
|
|
54
|
+
"@ac-kit/vitest-config": "0.1.1",
|
|
55
|
+
"@typescript/native": "typescript@7.0.2",
|
|
56
|
+
"rimraf": "6.1.3",
|
|
57
|
+
"typedoc": "0.28.20",
|
|
58
|
+
"typescript": "@typescript/typescript6@6.0.2"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=24"
|
|
62
|
+
}
|
|
6
63
|
}
|