Skip to content

Commit

Permalink
typescript 4.9 doesn't support const generics yet
Browse files Browse the repository at this point in the history
  • Loading branch information
inferrinizzard committed Apr 16, 2024
1 parent 6fd903c commit 719a028
Show file tree
Hide file tree
Showing 25 changed files with 78 additions and 78 deletions.
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/CJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ export const cJSONOptions = {

/* cJSON generator target language */
export class CJSONTargetLanguage<
const DisplayName extends string = "C (cJSON)",
const Names extends readonly string[] = readonly ["cjson", "cJSON"],
const Extension extends string = "h"
DisplayName extends string = "C (cJSON)",
Names extends readonly string[] = readonly ["cjson", "cJSON"],
Extension extends string = "h"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "C (cJSON)" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/CPlusPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export const cPlusPlusOptions = {
};

export class CPlusPlusTargetLanguage<
const DisplayName extends string = "C++",
const Names extends readonly string[] = readonly ["c++", "cpp", "cplusplus"],
const Extension extends string = "cpp"
DisplayName extends string = "C++",
Names extends readonly string[] = readonly ["c++", "cpp", "cplusplus"],
Extension extends string = "cpp"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "C++" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/CSharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ export const cSharpOptions = {
};

export class CSharpTargetLanguage<
const DisplayName extends string = "C#",
const Names extends readonly string[] = readonly ["cs", "csharp"],
const Extension extends string = "cs"
DisplayName extends string = "C#",
Names extends readonly string[] = readonly ["cs", "csharp"],
Extension extends string = "cs"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "C#" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Crystal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { Option } from "../RendererOptions";
import { RenderContext } from "../Renderer";

export class CrystalTargetLanguage<
const DisplayName extends string = "Crystal",
const Names extends readonly string[] = readonly ["crystal", "cr", "crystallang"],
const Extension extends string = "cr"
DisplayName extends string = "Crystal",
Names extends readonly string[] = readonly ["crystal", "cr", "crystallang"],
Extension extends string = "cr"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Crystal" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Dart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export const dartOptions = {
};

export class DartTargetLanguage<
const DisplayName extends string = "Dart",
const Names extends readonly string[] = readonly ["dart"],
const Extension extends string = "dart"
DisplayName extends string = "Dart",
Names extends readonly string[] = readonly ["dart"],
Extension extends string = "dart"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Dart" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Elixir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ export const elixirOptions = {
};

export class ElixirTargetLanguage<
const DisplayName extends string = "Elixir",
const Names extends readonly string[] = readonly ["elixir"],
const Extension extends string = "ex"
DisplayName extends string = "Elixir",
Names extends readonly string[] = readonly ["elixir"],
Extension extends string = "ex"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Elixir" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Elm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const elmOptions = {
};

export class ElmTargetLanguage<
const DisplayName extends string = "Elm",
const Names extends readonly string[] = readonly ["elm"],
const Extension extends string = "elm"
DisplayName extends string = "Elm",
Names extends readonly string[] = readonly ["elm"],
Extension extends string = "elm"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Elm" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Golang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const goOptions = {
};

export class GoTargetLanguage<
const DisplayName extends string = "Go",
const Names extends readonly string[] = readonly ["go", "golang"],
const Extension extends string = "go"
DisplayName extends string = "Go",
Names extends readonly string[] = readonly ["go", "golang"],
Extension extends string = "go"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Go" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Haskell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const haskellOptions = {
};

export class HaskellTargetLanguage<
const DisplayName extends string = "Haskell",
const Names extends readonly string[] = readonly ["haskell"],
const Extension extends string = "haskell"
DisplayName extends string = "Haskell",
Names extends readonly string[] = readonly ["haskell"],
Extension extends string = "haskell"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Haskell" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/JSONSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { Option } from "../RendererOptions";
import { RenderContext } from "../Renderer";

export class JSONSchemaTargetLanguage<
const DisplayName extends string = "JSON Schema",
const Names extends readonly string[] = readonly ["schema", "json-schema"],
const Extension extends string = "schema"
DisplayName extends string = "JSON Schema",
Names extends readonly string[] = readonly ["schema", "json-schema"],
Extension extends string = "schema"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "JSON Schema" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export const javaOptions = {
};

export class JavaTargetLanguage<
const DisplayName extends string = "Java",
const Names extends readonly string[] = readonly ["java"],
const Extension extends string = "java"
DisplayName extends string = "Java",
Names extends readonly string[] = readonly ["java"],
Extension extends string = "java"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Java" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/JavaScriptPropTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export const javaScriptPropTypesOptions = {
};

export class JavaScriptPropTypesTargetLanguage<
const DisplayName extends string = "JavaScript PropTypes",
const Names extends readonly string[] = readonly ["javascript-prop-types"],
const Extension extends string = "js"
DisplayName extends string = "JavaScript PropTypes",
Names extends readonly string[] = readonly ["javascript-prop-types"],
Extension extends string = "js"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "JavaScript PropTypes" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Kotlin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export const kotlinOptions = {
};

export class KotlinTargetLanguage<
const DisplayName extends string = "Kotlin",
const Names extends readonly string[] = readonly ["kotlin"],
const Extension extends string = "kt"
DisplayName extends string = "Kotlin",
Names extends readonly string[] = readonly ["kotlin"],
Extension extends string = "kt"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Kotlin" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Objective-C.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export const objcOptions = {
};

export class ObjectiveCTargetLanguage<
const DisplayName extends string = "Objective-C",
const Names extends readonly string[] = readonly ["objc", "objective-c", "objectivec"],
const Extension extends string = "m"
DisplayName extends string = "Objective-C",
Names extends readonly string[] = readonly ["objc", "objective-c", "objectivec"],
Extension extends string = "m"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Objective-C" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Php.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const phpOptions = {
};

export class PhpTargetLanguage<
const DisplayName extends string = "PHP",
const Names extends readonly string[] = readonly ["php"],
const Extension extends string = "php"
DisplayName extends string = "PHP",
Names extends readonly string[] = readonly ["php"],
Extension extends string = "php"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "PHP" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Pike.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ const namingFunction = funPrefixNamer("genericNamer", makeNameStyle("underscore"
const namedTypeNamingFunction = funPrefixNamer("typeNamer", makeNameStyle("pascal", legalizeName));

export class PikeTargetLanguage<
const DisplayName extends string = "Pike",
const Names extends readonly string[] = readonly ["pike", "pikelang"],
const Extension extends string = "pmod"
DisplayName extends string = "Pike",
Names extends readonly string[] = readonly ["pike", "pikelang"],
Extension extends string = "pmod"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Pike" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export const pythonOptions = {
};

export class PythonTargetLanguage<
const DisplayName extends string = "Python",
const Names extends readonly string[] = readonly ["python", "py"],
const Extension extends string = "py"
DisplayName extends string = "Python",
Names extends readonly string[] = readonly ["python", "py"],
Extension extends string = "py"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Python" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ const namingStyles: Record<string, NamingStyle> = {
};

export class RustTargetLanguage<
const DisplayName extends string = "Rust",
const Names extends readonly string[] = readonly ["rust", "rs", "rustlang"],
const Extension extends string = "rs"
DisplayName extends string = "Rust",
Names extends readonly string[] = readonly ["rust", "rs", "rustlang"],
Extension extends string = "rs"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Rust" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Scala3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,9 @@ export class CirceRenderer extends Scala3Renderer {
}

export class Scala3TargetLanguage<
const DisplayName extends string = "Scala3",
const Names extends readonly string[] = readonly ["scala3"],
const Extension extends string = "scala"
DisplayName extends string = "Scala3",
Names extends readonly string[] = readonly ["scala3"],
Extension extends string = "scala"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Scala3" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Smithy4s.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,9 @@ export class Smithy4sRenderer extends ConvenienceRenderer {
}

export class SmithyTargetLanguage<
const DisplayName extends string = "Smithy",
const Names extends readonly string[] = readonly ["Smithy"],
const Extension extends string = "smithy"
DisplayName extends string = "Smithy",
Names extends readonly string[] = readonly ["Smithy"],
Extension extends string = "smithy"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Smithy" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/Swift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ export interface SwiftProperty {
}

export class SwiftTargetLanguage<
const DisplayName extends string = "Swift",
const Names extends readonly string[] = readonly ["swift", "swift4"],
const Extension extends string = "swift"
DisplayName extends string = "Swift",
Names extends readonly string[] = readonly ["swift", "swift4"],
Extension extends string = "swift"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Swift" as DisplayName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const typeScriptEffectSchemaOptions = {
};

export class TypeScriptEffectSchemaTargetLanguage<
const DisplayName extends string = "TypeScript Effect Schema",
const Names extends readonly string[] = readonly ["typescript-effect-schema"],
const Extension extends string = "ts"
DisplayName extends string = "TypeScript Effect Schema",
Names extends readonly string[] = readonly ["typescript-effect-schema"],
Extension extends string = "ts"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "TypeScript Effect Schema" as DisplayName,
Expand Down
12 changes: 6 additions & 6 deletions packages/quicktype-core/src/language/TypeScriptFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export abstract class TypeScriptFlowBaseTargetLanguage<
}

export class TypeScriptTargetLanguage<
const DisplayName extends string = "TypeScript",
const Names extends readonly string[] = readonly ["typescript", "ts", "tsx"],
const Extension extends string = "ts"
DisplayName extends string = "TypeScript",
Names extends readonly string[] = readonly ["typescript", "ts", "tsx"],
Extension extends string = "ts"
> extends TypeScriptFlowBaseTargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "TypeScript" as DisplayName,
Expand Down Expand Up @@ -356,9 +356,9 @@ export class TypeScriptRenderer extends TypeScriptFlowBaseRenderer {
}

export class FlowTargetLanguage<
const DisplayName extends string = "Flow",
const Names extends readonly string[] = readonly ["flow"],
const Extension extends string = "js"
DisplayName extends string = "Flow",
Names extends readonly string[] = readonly ["flow"],
Extension extends string = "js"
> extends TypeScriptFlowBaseTargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Flow" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/TypeScriptZod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const typeScriptZodOptions = {
};

export class TypeScriptZodTargetLanguage<
const DisplayName extends string = "TypeScript Zod",
const Names extends readonly string[] = readonly ["typescript-zod"],
const Extension extends string = "ts"
DisplayName extends string = "TypeScript Zod",
Names extends readonly string[] = readonly ["typescript-zod"],
Extension extends string = "ts"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "TypeScript Zod" as DisplayName,
Expand Down
6 changes: 3 additions & 3 deletions packages/quicktype-core/src/language/ruby/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export const rubyOptions = {
};

export class RubyTargetLanguage<
const DisplayName extends string = "Ruby",
const Names extends readonly string[] = readonly ["ruby"],
const Extension extends string = "rb"
DisplayName extends string = "Ruby",
Names extends readonly string[] = readonly ["ruby"],
Extension extends string = "rb"
> extends TargetLanguage<DisplayName, Names, Extension> {
constructor(
displayName = "Ruby" as DisplayName,
Expand Down

0 comments on commit 719a028

Please sign in to comment.