@vnejs/contracts.rpg.damage 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.
@@ -0,0 +1,13 @@
1
+ export declare const CONSTANTS: {
2
+ readonly SOURCES: {
3
+ readonly PHYSICAL: "physical";
4
+ readonly MAGIC: "magic";
5
+ };
6
+ readonly SUBSOURCES: {
7
+ readonly FIRE: "fire";
8
+ readonly ICE: "ice";
9
+ readonly PIERCING: "piercing";
10
+ readonly FIST: "fist";
11
+ };
12
+ };
13
+ export type Constants = typeof CONSTANTS;
package/dist/const.js ADDED
@@ -0,0 +1,12 @@
1
+ export const CONSTANTS = {
2
+ SOURCES: {
3
+ PHYSICAL: "physical",
4
+ MAGIC: "magic",
5
+ },
6
+ SUBSOURCES: {
7
+ FIRE: "fire",
8
+ ICE: "ice",
9
+ PIERCING: "piercing",
10
+ FIST: "fist",
11
+ },
12
+ };
@@ -0,0 +1,5 @@
1
+ export declare const SUBSCRIBE_EVENTS: {
2
+ readonly EMIT: "vne:damage:emit";
3
+ readonly CALC_DAMAGE: "vne:damage:calc_damage";
4
+ };
5
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/dist/events.js ADDED
@@ -0,0 +1,4 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ EMIT: "vne:damage:emit",
3
+ CALC_DAMAGE: "vne:damage:calc_damage",
4
+ };
@@ -0,0 +1,33 @@
1
+ import "@vnejs/module";
2
+ import "@vnejs/shared";
3
+ import { CONSTANTS } from "./const.js";
4
+ import { SUBSCRIBE_EVENTS } from "./events.js";
5
+ export declare const PLUGIN_NAME: "DAMAGE";
6
+ export type PluginName = typeof PLUGIN_NAME;
7
+ export { CONSTANTS };
8
+ export type { Constants } from "./const.js";
9
+ export { SUBSCRIBE_EVENTS };
10
+ export type { SubscribeEvents } from "./events.js";
11
+ export type DamageModifier = {
12
+ shiftBase?: number;
13
+ multiplicator?: number;
14
+ shiftFinal?: number;
15
+ };
16
+ export type DamageEmitPayload = {
17
+ from: string;
18
+ to: string;
19
+ damage?: number;
20
+ } & Record<string, unknown>;
21
+ export type DamageCalcPayload = {
22
+ from: string;
23
+ to: string;
24
+ value: number;
25
+ other: Record<string, unknown>;
26
+ };
27
+ export type DamageResult = number;
28
+ declare module "@vnejs/shared" {
29
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
30
+ }
31
+ interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {
32
+ }
33
+ }
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import "@vnejs/module";
2
+ import "@vnejs/shared";
3
+ import { CONSTANTS } from "./const.js";
4
+ import { SUBSCRIBE_EVENTS } from "./events.js";
5
+ export const PLUGIN_NAME = "DAMAGE";
6
+ export { CONSTANTS };
7
+ export { SUBSCRIBE_EVENTS };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@vnejs/contracts.rpg.damage",
3
+ "version": "0.1.1",
4
+ "description": "Contracts for @vnejs/plugins.rpg.damage",
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
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "src",
18
+ "tsconfig.json"
19
+ ],
20
+ "scripts": {
21
+ "build": "npx @vnejs/monorepo package",
22
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
23
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
24
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
25
+ },
26
+ "author": "",
27
+ "license": "ISC",
28
+ "peerDependencies": {
29
+ "@vnejs/module": "~0.1.0",
30
+ "@vnejs/shared": "~0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@vnejs/configs.ts-common": "~0.1.0"
34
+ }
35
+ }
package/src/const.ts ADDED
@@ -0,0 +1,14 @@
1
+ export const CONSTANTS = {
2
+ SOURCES: {
3
+ PHYSICAL: "physical",
4
+ MAGIC: "magic",
5
+ },
6
+ SUBSOURCES: {
7
+ FIRE: "fire",
8
+ ICE: "ice",
9
+ PIERCING: "piercing",
10
+ FIST: "fist",
11
+ },
12
+ } as const;
13
+
14
+ export type Constants = typeof CONSTANTS;
package/src/events.ts ADDED
@@ -0,0 +1,6 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ EMIT: "vne:damage:emit",
3
+ CALC_DAMAGE: "vne:damage:calc_damage",
4
+ } as const;
5
+
6
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/src/index.ts ADDED
@@ -0,0 +1,40 @@
1
+ import "@vnejs/module";
2
+ import "@vnejs/shared";
3
+
4
+ import { CONSTANTS } from "./const.js";
5
+ import { SUBSCRIBE_EVENTS } from "./events.js";
6
+
7
+ export const PLUGIN_NAME = "DAMAGE" as const;
8
+ export type PluginName = typeof PLUGIN_NAME;
9
+
10
+ export { CONSTANTS };
11
+ export type { Constants } from "./const.js";
12
+ export { SUBSCRIBE_EVENTS };
13
+ export type { SubscribeEvents } from "./events.js";
14
+
15
+ export type DamageModifier = {
16
+ shiftBase?: number;
17
+ multiplicator?: number;
18
+ shiftFinal?: number;
19
+ };
20
+
21
+ export type DamageEmitPayload = {
22
+ from: string;
23
+ to: string;
24
+ damage?: number;
25
+ } & Record<string, unknown>;
26
+
27
+ export type DamageCalcPayload = {
28
+ from: string;
29
+ to: string;
30
+ value: number;
31
+ other: Record<string, unknown>;
32
+ };
33
+
34
+ export type DamageResult = number;
35
+
36
+ declare module "@vnejs/shared" {
37
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
38
+
39
+ interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {}
40
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@vnejs/configs.ts-common/tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["dist", "node_modules"]
9
+ }