Skip to content

Commit

Permalink
feat(ajsttil): update il with object type and index signature
Browse files Browse the repository at this point in the history
  • Loading branch information
notaphplover committed Sep 10, 2023
1 parent f266fb4 commit c7ad836
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/transformers/ajsttil/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [UNRELEASED]

### Added
- Added `TypeMetadata`.
- Added `AndTypeMetadata`
- Added `AnyTypeMetadata`
- Added `ArrayTypeMetadata`
- Added `BooleanTypeMetadata`
- Added `FloatTypeMetadata`
- Added `IndexSignatureType`
- Added `IntegerTypeMetadata`
- Added `LiteralTypeMetadata`
- Added `NoneTypeMetadata`
- Added `ObjectTypeMetadata`
- Added `OrTypeMetadata`
- Added `PropertyTypeMetadata`
- Added `StringTypeMetadata`
- Added `XorTypeMetadata`



10 changes: 9 additions & 1 deletion packages/transformers/ajsttil/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ export enum TypeMetadataKind {
arrayType,
booleanType,
floatType,
indexSignatureType,
integerType,
literalType,
noneType,
objectType,
or,
propertyType,
stringType,
Expand All @@ -29,7 +31,7 @@ export interface ManyChildrenTypeMetadata<
TKind extends TypeMetadataKind,
TChildren extends TypeMedatata[] = TypeMedatata[],
> extends BaseTypeMetadata<TKind> {
children: TChildren[];
children: TChildren;
}

export type AndTypeMetadata = ManyChildrenTypeMetadata<TypeMetadataKind.and>;
Expand All @@ -39,16 +41,20 @@ export type ArrayTypeMetadata =
export type BooleanTypeMetadata =
BaseTypeMetadata<TypeMetadataKind.booleanType>;
export type FloatTypeMetadata = BaseTypeMetadata<TypeMetadataKind.floatType>;
export type IndexSignatureType =
OneChildTypeMetadata<TypeMetadataKind.indexSignatureType>;
export type IntegerTypeMetadata =
BaseTypeMetadata<TypeMetadataKind.integerType>;
export interface LiteralTypeMetadata
extends BaseTypeMetadata<TypeMetadataKind.literalType> {
literal: JsonValue;
}
export type NoneTypeMetadata = BaseTypeMetadata<TypeMetadataKind.noneType>;
export type ObjectTypeMetadata = BaseTypeMetadata<TypeMetadataKind.objectType>;
export type OrTypeMetadata = ManyChildrenTypeMetadata<TypeMetadataKind.or>;
export interface PropertyTypeMetadata
extends OneChildTypeMetadata<TypeMetadataKind.propertyType> {
isOptional: boolean;
property: string;
}
export type StringTypeMetadata = BaseTypeMetadata<TypeMetadataKind.stringType>;
Expand All @@ -60,9 +66,11 @@ export type TypeMedatata =
| ArrayTypeMetadata
| BooleanTypeMetadata
| FloatTypeMetadata
| IndexSignatureType
| IntegerTypeMetadata
| LiteralTypeMetadata
| NoneTypeMetadata
| ObjectTypeMetadata
| OrTypeMetadata
| PropertyTypeMetadata
| StringTypeMetadata
Expand Down

0 comments on commit c7ad836

Please sign in to comment.