fix: generate typescript types for healthcheck pkg (#8846)

This commit is contained in:
Colin Adler
2023-08-03 16:20:46 -05:00
committed by GitHub
parent 72780c8031
commit 8ee500c59d
21 changed files with 333 additions and 204 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
package enums
package codersdk
type (
Enum string
-2
View File
@@ -1,5 +1,3 @@
// Code generated by 'make site/src/api/typesGenerated.ts'. DO NOT EDIT.
// From codersdk/enums.go
export type Enums = Enum[]
+1 -1
View File
@@ -1,4 +1,4 @@
package genericmap
package codersdk
type Foo struct {
Bar string `json:"bar"`
-2
View File
@@ -1,5 +1,3 @@
// Code generated by 'make site/src/api/typesGenerated.ts'. DO NOT EDIT.
// From codersdk/genericmap.go
export interface Buzz {
readonly foo: Foo
+17 -17
View File
@@ -1,4 +1,4 @@
package generics
package codersdk
import "time"
@@ -10,26 +10,26 @@ type Custom interface {
string | bool | int | time.Duration | []string | *int
}
// StaticGeneric has all generic fields defined in the field
type StaticGeneric struct {
Static GenericFields[string, int, time.Duration, string] `json:"static"`
// Static has all generic fields defined in the field
type Static struct {
Static Fields[string, int, time.Duration, string] `json:"static"`
}
// DynamicGeneric can has some dynamic fields
type DynamicGeneric[A any, S Single] struct {
Dynamic GenericFields[bool, A, string, S] `json:"dynamic"`
Comparable bool `json:"comparable"`
// Dynamic has some dynamic fields.
type Dynamic[A any, S Single] struct {
Dynamic Fields[bool, A, string, S] `json:"dynamic"`
Comparable bool `json:"comparable"`
}
type ComplexGeneric[C comparable, S Single, T Custom] struct {
Dynamic GenericFields[C, bool, string, S] `json:"dynamic"`
Order GenericFieldsDiffOrder[C, string, S, T] `json:"order"`
Comparable C `json:"comparable"`
Single S `json:"single"`
Static StaticGeneric `json:"static"`
type Complex[C comparable, S Single, T Custom] struct {
Dynamic Fields[C, bool, string, S] `json:"dynamic"`
Order FieldsDiffOrder[C, string, S, T] `json:"order"`
Comparable C `json:"comparable"`
Single S `json:"single"`
Static Static `json:"static"`
}
type GenericFields[C comparable, A any, T Custom, S Single] struct {
type Fields[C comparable, A any, T Custom, S Single] struct {
Comparable C `json:"comparable"`
Any A `json:"any"`
@@ -38,6 +38,6 @@ type GenericFields[C comparable, A any, T Custom, S Single] struct {
SingleConstraint S `json:"single_constraint"`
}
type GenericFieldsDiffOrder[A any, C comparable, S Single, T Custom] struct {
GenericFields[C, A, T, S]
type FieldsDiffOrder[A any, C comparable, S Single, T Custom] struct {
Fields Fields[C, A, T, S]
}
+11 -13
View File
@@ -1,22 +1,20 @@
// Code generated by 'make site/src/api/typesGenerated.ts'. DO NOT EDIT.
// From codersdk/generics.go
export interface ComplexGeneric<C extends comparable, S extends Single, T extends Custom> {
readonly dynamic: GenericFields<C, boolean, string, S>
readonly order: GenericFieldsDiffOrder<C, string, S, T>
export interface Complex<C extends comparable, S extends Single, T extends Custom> {
readonly dynamic: Fields<C, boolean, string, S>
readonly order: FieldsDiffOrder<C, string, S, T>
readonly comparable: C
readonly single: S
readonly static: StaticGeneric
readonly static: Static
}
// From codersdk/generics.go
export interface DynamicGeneric<A extends any, S extends Single> {
readonly dynamic: GenericFields<boolean, A, string, S>
export interface Dynamic<A extends any, S extends Single> {
readonly dynamic: Fields<boolean, A, string, S>
readonly comparable: boolean
}
// From codersdk/generics.go
export interface GenericFields<C extends comparable, A extends any, T extends Custom, S extends Single> {
export interface Fields<C extends comparable, A extends any, T extends Custom, S extends Single> {
readonly comparable: C
readonly any: A
readonly custom: T
@@ -25,13 +23,13 @@ export interface GenericFields<C extends comparable, A extends any, T extends Cu
}
// From codersdk/generics.go
export interface GenericFieldsDiffOrder<A extends any, C extends comparable, S extends Single, T extends Custom> {
readonly GenericFields: GenericFields<C, A, T, S>
export interface FieldsDiffOrder<A extends any, C extends comparable, S extends Single, T extends Custom> {
readonly Fields: Fields<C, A, T, S>
}
// From codersdk/generics.go
export interface StaticGeneric {
readonly static: GenericFields<string, number, number, string>
export interface Static {
readonly static: Fields<string, number, number, string>
}
// From codersdk/generics.go