@blankways/remote 0.0.0-stage → 0.1.0-alpha.2

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 (107) hide show
  1. package/dist/classes.d.ts +6 -0
  2. package/dist/classes.js +7 -0
  3. package/dist/classes.js.map +1 -0
  4. package/dist/functions/api.d.ts +48 -0
  5. package/dist/functions/api.js +43 -0
  6. package/dist/functions/api.js.map +1 -0
  7. package/dist/functions/index.d.ts +4 -0
  8. package/dist/functions/index.js +5 -0
  9. package/dist/functions/index.js.map +1 -0
  10. package/dist/functions/pointers/creation.d.ts +12 -0
  11. package/dist/functions/pointers/creation.js +24 -0
  12. package/dist/functions/pointers/creation.js.map +1 -0
  13. package/dist/functions/pointers/emission.d.ts +15 -0
  14. package/dist/functions/pointers/emission.js +64 -0
  15. package/dist/functions/pointers/emission.js.map +1 -0
  16. package/dist/functions/pointers/index.d.ts +4 -0
  17. package/dist/functions/pointers/index.js +5 -0
  18. package/dist/functions/pointers/index.js.map +1 -0
  19. package/dist/functions/pointers/reception.d.ts +10 -0
  20. package/dist/functions/pointers/reception.js +54 -0
  21. package/dist/functions/pointers/reception.js.map +1 -0
  22. package/dist/functions/pointers/resource.d.ts +8 -0
  23. package/dist/functions/pointers/resource.js +134 -0
  24. package/dist/functions/pointers/resource.js.map +1 -0
  25. package/dist/functions/state.d.ts +13 -0
  26. package/dist/functions/state.js +27 -0
  27. package/dist/functions/state.js.map +1 -0
  28. package/dist/functions/transport.d.ts +4 -0
  29. package/dist/functions/transport.js +26 -0
  30. package/dist/functions/transport.js.map +1 -0
  31. package/dist/index.d.ts +4 -0
  32. package/dist/index.js +5 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/libraries/events/classes.d.ts +7 -0
  35. package/dist/libraries/events/classes.js +8 -0
  36. package/dist/libraries/events/classes.js.map +1 -0
  37. package/dist/libraries/events/functions.d.ts +9 -0
  38. package/dist/libraries/events/functions.js +81 -0
  39. package/dist/libraries/events/functions.js.map +1 -0
  40. package/dist/libraries/events/index.d.ts +3 -0
  41. package/dist/libraries/events/index.js +4 -0
  42. package/dist/libraries/events/index.js.map +1 -0
  43. package/dist/libraries/events/runtime.d.ts +4 -0
  44. package/dist/libraries/events/runtime.js +9 -0
  45. package/dist/libraries/events/runtime.js.map +1 -0
  46. package/dist/libraries/events/types.d.ts +10 -0
  47. package/dist/libraries/events/types.js +2 -0
  48. package/dist/libraries/events/types.js.map +1 -0
  49. package/dist/libraries/result/classes.d.ts +5 -0
  50. package/dist/libraries/result/classes.js +6 -0
  51. package/dist/libraries/result/classes.js.map +1 -0
  52. package/dist/libraries/result/functions.d.ts +3 -0
  53. package/dist/libraries/result/functions.js +9 -0
  54. package/dist/libraries/result/functions.js.map +1 -0
  55. package/dist/libraries/result/index.d.ts +6 -0
  56. package/dist/libraries/result/index.js +5 -0
  57. package/dist/libraries/result/index.js.map +1 -0
  58. package/dist/libraries/result/types.d.ts +15 -0
  59. package/dist/libraries/result/types.js +2 -0
  60. package/dist/libraries/result/types.js.map +1 -0
  61. package/dist/runtime/common.d.ts +9 -0
  62. package/dist/runtime/common.js +117 -0
  63. package/dist/runtime/common.js.map +1 -0
  64. package/dist/runtime/context.d.ts +40 -0
  65. package/dist/runtime/context.js +33 -0
  66. package/dist/runtime/context.js.map +1 -0
  67. package/dist/runtime/index.d.ts +4 -0
  68. package/dist/runtime/index.js +5 -0
  69. package/dist/runtime/index.js.map +1 -0
  70. package/dist/runtime/prefabs.d.ts +5 -0
  71. package/dist/runtime/prefabs.js +34 -0
  72. package/dist/runtime/prefabs.js.map +1 -0
  73. package/dist/runtime/resource.d.ts +5 -0
  74. package/dist/runtime/resource.js +6 -0
  75. package/dist/runtime/resource.js.map +1 -0
  76. package/dist/runtime/schemas.d.ts +13 -0
  77. package/dist/runtime/schemas.js +15 -0
  78. package/dist/runtime/schemas.js.map +1 -0
  79. package/dist/runtime/transport.d.ts +1 -0
  80. package/dist/runtime/transport.js +3 -0
  81. package/dist/runtime/transport.js.map +1 -0
  82. package/dist/types/common.d.ts +14 -0
  83. package/dist/types/common.js +2 -0
  84. package/dist/types/common.js.map +1 -0
  85. package/dist/types/errors.d.ts +14 -0
  86. package/dist/types/errors.js +2 -0
  87. package/dist/types/errors.js.map +1 -0
  88. package/dist/types/index.d.ts +3 -0
  89. package/dist/types/index.js +4 -0
  90. package/dist/types/index.js.map +1 -0
  91. package/dist/types/pointers/call.d.ts +15 -0
  92. package/dist/types/pointers/call.js +2 -0
  93. package/dist/types/pointers/call.js.map +1 -0
  94. package/dist/types/pointers/index.d.ts +2 -0
  95. package/dist/types/pointers/index.js +3 -0
  96. package/dist/types/pointers/index.js.map +1 -0
  97. package/dist/types/pointers/resource.d.ts +4 -0
  98. package/dist/types/pointers/resource.js +2 -0
  99. package/dist/types/pointers/resource.js.map +1 -0
  100. package/dist/types/pointers/schema.d.ts +10 -0
  101. package/dist/types/pointers/schema.js +2 -0
  102. package/dist/types/pointers/schema.js.map +1 -0
  103. package/dist/types/state.d.ts +2 -0
  104. package/dist/types/state.js +2 -0
  105. package/dist/types/state.js.map +1 -0
  106. package/package.json +52 -3
  107. package/README.md +0 -3
@@ -0,0 +1,14 @@
1
+ import { Serial } from '@blankways/serial';
2
+ import type { SchemaPointer } from './pointers/schema.js';
3
+ export type InternalSchema = SchemaPointer<{
4
+ id: typeof Serial.u32;
5
+ info: typeof Serial.string;
6
+ }>;
7
+ export type InternalErrorPacket = {
8
+ id: number;
9
+ requestId: number;
10
+ type: number;
11
+ pointer: number;
12
+ info: string;
13
+ };
14
+ export type ErrorHandler = (packet: InternalErrorPacket) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../source/types/errors.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './common.js';
2
+ export * from './errors.js';
3
+ export * from './state.js';
@@ -0,0 +1,4 @@
1
+ export * from './common.js';
2
+ export * from './errors.js';
3
+ export * from './state.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { Serial } from '@blankways/serial';
2
+ import type { PacketEntry, SchemaEntry } from '@blankways/serial';
3
+ import type { InternalSchema } from '../errors.js';
4
+ import type { PeerId, PointerId, RequestId } from '../common.js';
5
+ import type { AnyTypeDefinition, SchemaPointer } from './schema.js';
6
+ export type CallPointer<Schemas extends readonly SchemaPointer<{
7
+ [Key in string]: AnyTypeDefinition;
8
+ } & {
9
+ id: typeof Serial.u32;
10
+ }>[], Entry extends SchemaEntry> = PointerId<[Entry, Schemas]>;
11
+ export type CallPacketType<Pointer extends SchemaPointer<SchemaEntry>> = Pointer extends SchemaPointer<infer Entry> ? PacketEntry<Entry> : never;
12
+ export type CallInternalSchemas = InternalSchema;
13
+ export type CallHandler<Entry extends SchemaEntry = SchemaEntry> = (peer: PeerId | undefined, entry: PacketEntry<Entry>, requestId?: RequestId) => unknown;
14
+ export type CallListener = (peer: PeerId, entry: PacketEntry, requestId: RequestId) => void;
15
+ export type CallResolver = (response: PacketEntry<SchemaEntry>) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../source/types/pointers/call.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './call.js';
2
+ export * from './resource.js';
@@ -0,0 +1,3 @@
1
+ export * from './call.js';
2
+ export * from './resource.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/types/pointers/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { PointerId } from '../common.js';
2
+ export type ResourceValue = number | boolean | string;
3
+ export type ResourceTypes = ResourceValue;
4
+ export type ResourcePointer<Type extends ResourceTypes = ResourceTypes> = PointerId<['resource', Type]>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../source/types/pointers/resource.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { SchemaEntry } from '@blankways/serial';
2
+ import { PointerId } from '../common.js';
3
+ export type SchemaPointer<Entry extends SchemaEntry> = PointerId<Entry>;
4
+ export type AnyTypeDefinition = {
5
+ staticSize: number;
6
+ hasDynamicData?: boolean;
7
+ plan: (entry: never) => number;
8
+ write: (entry: never, view: DataView, staticOffset: number, dynamicOffset: number, dynamicLength: number) => void;
9
+ read: (view: DataView, staticOffset: number) => unknown;
10
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../source/types/pointers/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type { StateId } from '@blankways/state';
2
+ export type StateWatcher<Type> = (value: Type) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../source/types/state.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@blankways/remote",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-alpha.2",
4
+ "description": "",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "keywords": [],
17
+ "author": "",
18
+ "license": "ISC",
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "devEngines": {
23
+ "packageManager": {
24
+ "name": "pnpm",
25
+ "version": "12.18.0",
26
+ "onFail": "ignore"
27
+ }
28
+ },
29
+ "type": "module",
30
+ "peerDependencies": {
31
+ "@blankways/identity": "0.1.0-alpha.11f2a73",
32
+ "@blankways/serial": "0.1.0-alpha.fa636be",
33
+ "@blankways/state": "0.2.0-alpha.85cba23"
34
+ },
35
+ "devDependencies": {
36
+ "@blankways/identity": "0.1.0-alpha.11f2a73",
37
+ "@blankways/serial": "0.1.0-alpha.fa636be",
38
+ "@blankways/state": "0.2.0-alpha.85cba23",
39
+ "@types/node": "^26.6.6",
40
+ "@types/ws": "^8.18.2",
41
+ "tsc-alias": "^1.9.9",
42
+ "tsx": "^4.23.15",
43
+ "typescript": "^7.0.2",
44
+ "vitest": "^5.1.0",
45
+ "ws": "^8.23.0"
46
+ },
47
+ "scripts": {
48
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
49
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
50
+ "typecheck": "tsc --noEmit",
51
+ "test": "vitest",
52
+ "test:ws:server": "tsx test/server/app.ts",
53
+ "test:ws:client": "tsx test/client/app.ts"
54
+ }
6
55
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.