@elyx-code/project-logic-tree 0.0.6479 → 0.0.6481

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/dist/index.d.ts CHANGED
@@ -4280,6 +4280,13 @@ export declare function flattenVariableWrites(variable: VariableState, seenVaria
4280
4280
 
4281
4281
  export declare function flattenWrites(entity: ValueWritingEntityState, seenEntities?: Set<string>): ValueReadingEntityState[];
4282
4282
 
4283
+ /**
4284
+ * Holds keywords that are forbidden (so far in Javascript) to be used as names for entities.
4285
+ * This is used to validate the names of entities, such as functions, variables, etc.
4286
+ * For example, a property named "class", or "function" is forbidden, because those are reserved keywords in Javascript.
4287
+ */
4288
+ export declare const FORBIDDEN_KEYWORDS: string[];
4289
+
4283
4290
  declare const FORBIDDEN_SQL_KEYWORDS: string[];
4284
4291
 
4285
4292
  export declare function fromChangeSetToRecordChangeSet<TSelf extends {
@@ -14216,7 +14223,8 @@ export declare type PropertyTypesUnion = IProperty | IPropertyTransfer | IProper
14216
14223
  declare namespace propertyValidation {
14217
14224
  export {
14218
14225
  validate_4 as validate,
14219
- validateImplementation
14226
+ validateImplementation,
14227
+ validatePropertyEntityName
14220
14228
  }
14221
14229
  }
14222
14230
  export { propertyValidation }
@@ -15328,6 +15336,7 @@ export declare enum SharedEntityErrorCode {
15328
15336
  NameAsResolvedCodeNameNotUniqueInScope = "name-as-resolved-code-name-not-unique-in-scope",
15329
15337
  NameMustStartWithLetterOrUnderscore = "name-must-start-with-letter-or-underscore",
15330
15338
  NameCanOnlyContainLettersNumbersUnderscoreAndSpaces = "name-can-only-contain-letters-numbers-underscore-and-spaces",
15339
+ NameIsForbiddenKeyword = "name-is-forbidden-keyword",
15331
15340
  EmptyName = "empty-name",
15332
15341
  MissingCaller = "missing-caller",
15333
15342
  PropertyOverwritesOtherSiblingWithSameName = "property-overwrites-other-sibling-with-same-name",
@@ -15585,20 +15594,54 @@ export declare type TerminationState = ReturnStatementState | BreakStatementStat
15585
15594
 
15586
15595
  export declare type TestableEntityState = ExecutableEntityState;
15587
15596
 
15597
+ /**
15598
+ * First letter of each word is lowercase and the rest of the words, start in uppercase
15599
+ * someName
15600
+ *
15601
+ * @param str - The string to convert to camelCase
15602
+ * @returns The camelCase version of the string
15603
+ */
15588
15604
  export declare function toCamelCase(str: string): string;
15589
15605
 
15590
15606
  export declare function toEditorContext(extensionsRegistry: ExtensionsRegistry, editor: IEditor): DefaultEditorContext;
15591
15607
 
15592
15608
  export declare function toEntityState(entity: string | EntityState | IGenericReference | Element_2 | ElementTransfer | ElementShallowTransfer | ElementGenerationTarget, project: ProjectState): EntityState | null;
15593
15609
 
15610
+ /**
15611
+ * Words keep their original capitalization; we just insert dashes
15612
+ * some-name or SOME-NAME or Some-Name or sOme-NaMe
15613
+ *
15614
+ * @param str - The string to convert to kebab-case
15615
+ * @returns The kebab-case version of the string
15616
+ */
15594
15617
  export declare function toKebabCase(str: string): string;
15595
15618
 
15619
+ /**
15620
+ * Convert a string to kebab-case and then to lower case.
15621
+ *
15622
+ * @param str - The string to convert to lower case kebab-case
15623
+ * @returns The lower case kebab-case version of the string
15624
+ */
15596
15625
  export declare function toLowerCaseKebabCase(str: string): string;
15597
15626
 
15627
+ /**
15628
+ * First letter is uppercase; the rest of each word is left intact
15629
+ * SomeName or BlogContent or BlogCONTENT
15630
+ *
15631
+ * @param str - The string to convert to PascalCase
15632
+ * @returns The PascalCase version of the string
15633
+ */
15598
15634
  export declare function toPascalCase(str: string): string;
15599
15635
 
15600
15636
  export declare function toProjectLogicContext(extensionsRegistry: ExtensionsRegistry, project: ProjectState): DefaultProjectLogicContext;
15601
15637
 
15638
+ /**
15639
+ * Words keep their original capitalization; we just insert underscores
15640
+ * some_name or SOME_NAME or Some_Name or sOme_NaMe
15641
+ *
15642
+ * @param str - The string to convert to snake_case
15643
+ * @returns The snake_case version of the string
15644
+ */
15602
15645
  export declare function toSnakeCase(str: string): string;
15603
15646
 
15604
15647
  export declare function transitionProjectVersion(from: ChangeSet | 'initial', to: ChangeSet | 'initial', project: ProjectState): IProjectVersionTransitionConfig;
@@ -15849,7 +15892,9 @@ export declare const validateDataOperationOutputEntityDeclarationParentRef: IAct
15849
15892
 
15850
15893
  export declare function validateDefinitionEntityName(entity: DefinitionEntityState | IDefinitionEntityGenerationTarget | IDefinitionEntityShallowTransfer | IDefinitionEntityTransfer, project: ProjectState): EntityGenerationError[];
15851
15894
 
15852
- declare function validateDefinitionEntityName_2(self: DefinitionEntityState): EntityError[];
15895
+ declare function validateDefinitionEntityName_2(self: DefinitionEntityState, newName?: string): EntityError[];
15896
+
15897
+ export declare function validateEntityName(self: EntityWithNamesState, toCodeNameTransformers?: ((name: string) => string)[], otherRelevantEntitiesInNameSpace?: EntityWithNamesState[], newName?: string | null): EntityError[];
15853
15898
 
15854
15899
  export declare function validateEntryCaller(data: ElementGenerationTarget, callerEntity: CallerEntityState): EntityGenerationError[];
15855
15900
 
@@ -15861,7 +15906,7 @@ export declare function validateFunctionCallDeclaration(functionDeclarationId: E
15861
15906
 
15862
15907
  export declare function validateFunctionDeclarationName(entity: FunctionDeclarationState | IFunctionDeclarationGenerationTarget | IFunctionDeclarationShallowTransfer | IFunctionDeclarationTransfer, project: ProjectState): EntityGenerationError[];
15863
15908
 
15864
- declare function validateFunctionDeclarationName_2(self: FunctionDeclarationState): EntityError[];
15909
+ declare function validateFunctionDeclarationName_2(self: FunctionDeclarationState, newName?: string): EntityError[];
15865
15910
 
15866
15911
  export declare function validateGeneratedEntityParentIsNotBuiltInEntity(data: ElementGenerationTarget, project: ProjectState): EntityGenerationError[];
15867
15912
 
@@ -15892,6 +15937,8 @@ export declare function validateOperationEntityDeclaration(operationDeclarationI
15892
15937
 
15893
15938
  declare function validateParentRelation(self: InternalCallState): EntityError[];
15894
15939
 
15940
+ declare function validatePropertyEntityName(self: PropertyState, newName?: string): EntityError[];
15941
+
15895
15942
  export declare function validatePropertyName(entity: PropertyState | IPropertyGenerationTarget | IPropertyShallowTransfer | IPropertyTransfer, project: ProjectState): EntityGenerationError[];
15896
15943
 
15897
15944
  export declare function validateReachability(self: PassThroughCallableEntityState): EntityError[];
@@ -15933,7 +15980,7 @@ export declare function validateValueWritter(data: ElementGenerationTarget, valu
15933
15980
 
15934
15981
  export declare function validateVariableDeclarationName(entity: VariableDeclarationState | IVariableDeclarationGenerationTarget | IVariableDeclarationShallowTransfer | IVariableDeclarationTransfer, project: ProjectState): EntityGenerationError[];
15935
15982
 
15936
- declare function validateVariableDeclarationName_2(self: VariableDeclarationState): EntityError[];
15983
+ declare function validateVariableDeclarationName_2(self: VariableDeclarationState, newName?: string): EntityError[];
15937
15984
 
15938
15985
  export declare function validateVariableInternalCallUse(self: VariableState): EntityError[];
15939
15986