From 588d136fd22ab1c65aa04f557392d04c6b975ffa Mon Sep 17 00:00:00 2001 From: Nik Date: Thu, 29 Feb 2024 13:12:54 +1300 Subject: [PATCH] Fixes #41 ListenerResult was missing from the JSDoc type defs in ecs.js, so it never made it into ecs.d.ts, which prevents the project from building with TypeScript --- ecs.js | 4 ++++ types/ecs.d.ts | 4 ++++ types/ecs.d.ts.map | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ecs.js b/ecs.js index 62a3c42..da2d3d5 100644 --- a/ecs.js +++ b/ecs.js @@ -9,6 +9,10 @@ const now = (typeof performance === 'undefined') ? (() => Date.now()) : (() => p * @typedef { 'added' | 'removed' } ListenerType */ +/** + * @typedef { Entity[] } ListenerResult + */ + /** * @typedef { any } Component */ diff --git a/types/ecs.d.ts b/types/ecs.d.ts index ea376a2..dd99330 100644 --- a/types/ecs.d.ts +++ b/types/ecs.d.ts @@ -1,6 +1,9 @@ /** * @typedef { 'added' | 'removed' } ListenerType */ +/** + * @typedef { Entity[] } ListenerResult + */ /** * @typedef { any } Component */ @@ -211,6 +214,7 @@ declare namespace _default { } export default _default; export type ListenerType = 'added' | 'removed'; +export type ListenerResult = Entity[]; export type Component = any; export type Entity = { [key: string]: any; diff --git a/types/ecs.d.ts.map b/types/ecs.d.ts.map index 83017c8..7e4db17 100644 --- a/types/ecs.d.ts.map +++ b/types/ecs.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ecs.d.ts","sourceRoot":"","sources":["../ecs.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,KAAK,CAmEjB;AAGD;;;;GA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MR,MAAM;;;;;;;;;;;;;;cAIL,MAAM;qBACC,MAAM;;;;;;;;;mBAKd,MAAM;;;;kBAEN,MAAM;;;cAKN,MAAM,EAAE;aACR,SAAS;aACT,MAAM,EAAE;eACR,iBAAiB;sBACjB,kBAAkB;WAClB,UAAU"} \ No newline at end of file +{"version":3,"file":"ecs.d.ts","sourceRoot":"","sources":["../ecs.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;;;;;GAQG;AAEH;;;;;GAKG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;GAIG;AAEH;;GAEG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,sCAHW,MAAM,GACJ,KAAK,CAmEjB;AAGD;;;;GAIG;AACH,oCAHW,KAAK,GACH,MAAM,CAclB;AAGD,0DAEC;AAGD,8DAEC;AAGD;;;;;;;GAOG;AACH,4CANW,KAAK,UACL,MAAM,iBACN,MAAM,kBACN,SAAS,GACP,IAAI,CA+BhB;AAGD;;;;;;;GAOG;AACF,iDANU,KAAK,UACL,MAAM,iBACN,MAAM,oBACN,OAAO,GACL,IAAI,CAiBhB;AAGD;;;;;;GAMG;AACF,oCALU,KAAK,UACL,MAAM,oBACN,OAAO,GACL,IAAI,CAmBhB;AAGD;;;;;;;;;;;;;GAaG;AACH,mCAZW,KAAK,kBACL,MAAM,EAAE,iBAKR,YAAY,sCAIV,MAAM,EAAE,CAwCpB;AAGD;;;;;;;;;GASG;AACH,iCARW,KAAK,kBACL,MAAM,EAAE,GAKN,MAAM,GAAC,IAAI,CAIvB;AA8BD;;;;GAIG;AACH,iCAHW,KAAK,MACL,cAAc,QA+BxB;AAED;;;;GAIG;AACH,sCAHW,KAAK,MACL,MAAM,QAUhB;AAGD;;;;GAIG;AACH,mCAHW,KAAK,MACL,MAAM,QAUhB;A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