mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update generated array type definitions in TypeScript to be readonly (#12947)
* chore: types generated handling readonly slices * add -update flag to update goldens * revert excess gens * fix: update most UI types to account for readonly modifiers * fix: remove accidental mutation from NavBarView * fix: remove mutation warning for BatchUpdateConfirmation stories * fix: remove mutation warning for BactchUpdateConfirmation * fix: format ActiveUserChart * fix: update import to make linter happy * fix: update fmt issue * fix: disable file write lint rule from unit test --------- Co-authored-by: Parkreiner <throwawayclover@gmail.com>
This commit is contained in:
co-authored by
Parkreiner
parent
7cf8577f1c
commit
d9da054c9d
+6
-6
@@ -1,22 +1,22 @@
|
||||
package codersdk
|
||||
|
||||
type Foo struct {
|
||||
Bar string `json:"bar"`
|
||||
}
|
||||
|
||||
type Buzz struct {
|
||||
Foo `json:"foo"`
|
||||
Bazz string `json:"bazz"`
|
||||
}
|
||||
|
||||
type Custom interface {
|
||||
Foo | Buzz
|
||||
type Foo struct {
|
||||
Bar string `json:"bar"`
|
||||
}
|
||||
|
||||
type FooBuzz[R Custom] struct {
|
||||
Something []R `json:"something"`
|
||||
}
|
||||
|
||||
type Custom interface {
|
||||
Foo | Buzz
|
||||
}
|
||||
|
||||
// Not yet supported
|
||||
//type FooBuzzMap[R Custom] struct {
|
||||
// Something map[string]R `json:"something"`
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ export interface Foo {
|
||||
|
||||
// From codersdk/genericmap.go
|
||||
export interface FooBuzz<R extends Custom> {
|
||||
readonly something: R[]
|
||||
readonly something: (readonly R[])
|
||||
}
|
||||
|
||||
// From codersdk/genericmap.go
|
||||
export type Custom = Foo | Buzz
|
||||
export type Custom = Foo | Buzz
|
||||
Reference in New Issue
Block a user