@rbxts/covenant 1.0.0 → 1.0.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/README.md ADDED
File without changes
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
- "name": "@rbxts/covenant",
3
- "version": "1.0.0",
4
- "main": "out/init.lua",
5
- "scripts": {
6
- "build": "rbxtsc",
7
- "watch": "rbxtsc -w",
8
- "prepublishOnly": "npm run build"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/cuberootmctoasted/covenant.git"
13
- },
14
- "keywords": [],
15
- "author": "",
16
- "license": "ISC",
17
- "bugs": {
18
- "url": "https://github.com/cuberootmctoasted/covenant/issues"
19
- },
20
- "homepage": "https://github.com/cuberootmctoasted/covenant#readme",
21
- "description": "",
22
- "types": "out/index.d.ts",
23
- "files": [
24
- "out",
25
- "!**/*.tsbuildinfo"
26
- ],
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "devDependencies": {
31
- "@rbxts/compiler-types": "^3.0.0-types.0",
32
- "@rbxts/types": "^1.0.860",
33
- "@typescript-eslint/eslint-plugin": "^8.35.0",
34
- "@typescript-eslint/parser": "^8.35.0",
35
- "eslint": "^8.57.1",
36
- "eslint-config-prettier": "^10.1.5",
37
- "eslint-plugin-prettier": "^5.5.1",
38
- "eslint-plugin-roblox-ts": "^0.0.36",
39
- "prettier": "^3.6.1",
40
- "roblox-ts": "^3.0.0",
41
- "typescript": "^5.8.3"
42
- },
43
- "dependencies": {
44
- "@rbxts/jecs": "^0.6.1",
45
- "@rbxts/services": "^1.5.5"
46
- }
2
+ "name": "@rbxts/covenant",
3
+ "version": "1.0.1",
4
+ "main": "src/init.lua",
5
+ "scripts": {
6
+ "build": "rbxtsc",
7
+ "watch": "rbxtsc -w",
8
+ "prepublishOnly": "npm run build"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/cuberootmctoasted/covenant.git"
13
+ },
14
+ "keywords": [],
15
+ "author": "",
16
+ "license": "ISC",
17
+ "bugs": {
18
+ "url": "https://github.com/cuberootmctoasted/covenant/issues"
19
+ },
20
+ "homepage": "https://github.com/cuberootmctoasted/covenant#readme",
21
+ "description": "",
22
+ "types": "src/index.d.ts",
23
+ "files": [
24
+ "out",
25
+ "!**/*.tsbuildinfo"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "devDependencies": {
31
+ "@rbxts/compiler-types": "^3.0.0-types.0",
32
+ "@rbxts/types": "^1.0.860",
33
+ "@typescript-eslint/eslint-plugin": "^8.35.0",
34
+ "@typescript-eslint/parser": "^8.35.0",
35
+ "eslint": "^8.57.1",
36
+ "eslint-config-prettier": "^10.1.5",
37
+ "eslint-plugin-prettier": "^5.5.1",
38
+ "eslint-plugin-roblox-ts": "^0.0.36",
39
+ "prettier": "^3.6.1",
40
+ "roblox-ts": "^3.0.0",
41
+ "typescript": "^5.8.3"
42
+ },
43
+ "dependencies": {
44
+ "@rbxts/jecs": "^0.6.1",
45
+ "@rbxts/services": "^1.5.5"
46
+ }
47
47
  }
package/out/covenant.d.ts DELETED
@@ -1,77 +0,0 @@
1
- import { Entity, Id } from "@rbxts/jecs";
2
- import { CovenantHooks, Discriminator } from "./hooks";
3
- import { Remove, Delete } from "./stringEnums";
4
- export type WorldChangesForReplication = Map<string, Delete | Map<string, defined | Remove>>;
5
- export type WorldChangesForPrediction = Map<string, Map<string, defined | Remove>>;
6
- export interface CovenantProps {
7
- replicationSend: (player: Player, worldChanges: WorldChangesForReplication) => void;
8
- replicationSendAll?: (worldChanges: WorldChangesForReplication) => void;
9
- replicationConnect: (callback: (worldChanges: WorldChangesForReplication) => void) => void;
10
- predictionSend: (worldChanges: WorldChangesForPrediction) => void;
11
- predictionConnect: (callback: (player: Player, worldChanges: WorldChangesForPrediction) => void) => void;
12
- }
13
- type ComponentPredictionValidator = (player: Player, entity: Entity, newState: unknown, lastState: unknown) => boolean;
14
- export declare class Covenant {
15
- private _world;
16
- private systems;
17
- private worldChangesForReplication;
18
- private worldChangesForPrediction;
19
- private underivedStringifiedComponents;
20
- private replicatedStringifiedComponents;
21
- private predictedStringifiedComponents;
22
- private started;
23
- private stringifiedComponentSubscribers;
24
- private stringifiedComponentValidators;
25
- private replicationSend;
26
- private replicationConnect;
27
- private replicationSendAll;
28
- private predictionSend;
29
- private predictionConnect;
30
- constructor({ replicationSend, replicationConnect, replicationSendAll, predictionSend, predictionConnect, }: CovenantProps);
31
- private setupPredictionClient;
32
- private setupPredictionServer;
33
- private setupPrediction;
34
- private setupRelicationServer;
35
- private setupReplicationPayload;
36
- private setupReplicationClient;
37
- private setupReplication;
38
- start(): void;
39
- private schedule;
40
- private worldSet;
41
- subscribeComponent<T>(component: Entity<T>, subscriber: (entity: Entity, state: T | undefined, previousState: T | undefined) => void): () => void;
42
- private worldDelete;
43
- worldComponent<T extends defined>(): Entity<T>;
44
- private checkComponentDerived;
45
- private defineComponentNetworkBehavior;
46
- deriveComponent<T extends defined>({ component, queriedComponents, recipe, replicated, predictionValidator, }: {
47
- replicated: boolean;
48
- predictionValidator: ComponentPredictionValidator | false;
49
- component: Entity<T>;
50
- queriedComponents: Entity[][];
51
- recipe: (entity: Entity, lastState: T | undefined, updateId: number, hooks: CovenantHooks) => T | undefined;
52
- }): void;
53
- deriveChildren<T extends defined>({ parentComponent, parentEntityTrackerComponent, childIdentityComponent, getIdentifier, queriedComponents, recipe, replicated, predictionValidator, }: {
54
- replicated: boolean;
55
- predictionValidator: ComponentPredictionValidator | false;
56
- parentComponent: Entity<ReadonlyArray<T>>;
57
- parentEntityTrackerComponent: Entity<Map<Discriminator, Entity>>;
58
- childIdentityComponent: Entity<T>;
59
- getIdentifier: (state: T) => Discriminator;
60
- queriedComponents: Entity[][];
61
- recipe: (entity: Entity, lastChildrenStates: ReadonlyArray<T>, updateId: number, hooks: CovenantHooks) => ReadonlyArray<T>;
62
- }): void;
63
- deriveRootEntity<T extends defined>({ identityComponent, recipe, replicated, }: {
64
- replicated: boolean;
65
- identityComponent: Entity<T>;
66
- recipe: (updateId: number, hooks: CovenantHooks) => {
67
- statesToCreate: ReadonlyArray<T>;
68
- entitiesToDelete: ReadonlyArray<Entity>;
69
- };
70
- }): void;
71
- private worldEntity;
72
- worldQuery<T extends Id[]>(...components: T): import("@rbxts/jecs").Query<import("@rbxts/jecs").InferComponents<T>>;
73
- worldHas(entity: Entity, ...components: Id[]): boolean;
74
- worldGet<T extends [Id] | [Id, Id] | [Id, Id, Id] | [Id, Id, Id, Id]>(entity: Entity, ...components: T): import("@rbxts/jecs").FlattenTuple<[...import("@rbxts/jecs").Nullable<import("@rbxts/jecs").InferComponents<T>>]>;
75
- worldContains(entity: Entity): boolean;
76
- }
77
- export {};