mvahowe / proskomma-js

A JS Implementation of the Proskomma Scripture Processing Model
MIT License
11 stars 8 forks source link

Inconsistencies in the code #161

Open DanielC-N opened 7 months ago

DanielC-N commented 7 months ago

For a proper export for typescript we need to correct all the inconsistencies in the code.
IF it's possible.

src/graph/lib/tribos_expression.js(486,57): error TS2339: Property 'errors' does not exist on type 'string'.
src/graph/lib/tribos_expression.js(507,98): error TS2339: Property 'errors' does not exist on type 'string'.
src/graph/lib/tribos_expression.js(507,119): error TS2339: Property 'errors' does not exist on type 'string'.
src/model/doc_set_helpers/item.js(93,5): error TS2740: Type 'Set<any>' is missing the following properties from type 'any[]': length, pop, push, concat, and 21 more.
src/model/doc_set_helpers/item.js(115,26): error TS2339: Property 'add' does not exist on type 'any[]'.
src/model/doc_set_helpers/item.js(131,24): error TS2339: Property 'delete' does not exist on type 'any[]'.
src/model/doc_set_helpers/update.js(224,47): error TS2339: Property 'length' does not exist on type 'Set<any>'.
src/model/document_helpers/chapter_verse.js(240,7): error TS2365: Operator '+=' cannot be applied to types 'number' and 'number | boolean'.
src/model/versifications/index.js(9,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module.
src/parser/lexers/object_for_fragment.js(47,7): error TS2339: Property 'values' does not exist on type '{ subclass: any; key: any; valueString: any; }'.
src/parser/lexers/object_for_fragment.js(48,7): error TS2339: Property 'printValue' does not exist on type '{ subclass: any; key: any; valueString: any; }'.
src/parser/lib/tokenize.js(8,75): error TS2345: Argument of type 'string | RegExp' is not assignable to parameter of type 'string'.
  Type 'RegExp' is not assignable to type 'string'.
src/parser/lib/tokenize.js(9,39): error TS2339: Property 'xregexp' does not exist on type 'string | RegExp'.
  Property 'xregexp' does not exist on type 'string'.
src/pipelines/perf2x/index.js(1,31): error TS2307: Cannot find module './perf2usfmPipeline' or its corresponding type declarations.
src/pipelines/perf2x/index.js(2,33): error TS2307: Cannot find module './perf2PkJsonPipeline' or its corresponding type declarations.
src/transforms/calculateUsfmChapterPositions.js(61,18): error TS2365: Operator '>' cannot be applied to types 'string' and 'number'.
src/transforms/calculateUsfmChapterPositions.js(62,40): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
src/transforms/calculateUsfmChapterPositions.js(63,55): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
src/transforms/calculateUsfmChapterPositions.js(66,15): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type.
src/util/lib/versification/versification.js(184,17): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'string'.
src/util/lib/versification/versification.js(185,17): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'string'.
src/util/lib/versification/versification.js(198,19): error TS2339: Property 'push' does not exist on type 'string'.
src/util/lib/versification/versification.js(200,19): error TS2339: Property 'push' does not exist on type 'string'.