refactor(schema): tighten public contracts (#33771)
This commit is contained in:
parent
5682371d0a
commit
9e9d405d7e
49 changed files with 759 additions and 897 deletions
|
|
@ -1,6 +1,7 @@
|
|||
export * as Revert from "./revert"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema"
|
||||
import { NonNegativeInt, RelativePath } from "./schema"
|
||||
import { SessionMessage } from "./session-message"
|
||||
|
||||
|
|
@ -11,13 +12,13 @@ export const FileDiff = Schema.Struct({
|
|||
deletions: NonNegativeInt,
|
||||
patch: Schema.String,
|
||||
}).annotate({ identifier: "File.Diff" })
|
||||
export type FileDiff = typeof FileDiff.Type
|
||||
export interface FileDiff extends Schema.Schema.Type<typeof FileDiff> {}
|
||||
|
||||
export const State = Schema.Struct({
|
||||
messageID: SessionMessage.ID,
|
||||
partID: Schema.String.pipe(Schema.optional),
|
||||
snapshot: Schema.String.pipe(Schema.optional),
|
||||
diff: Schema.String.pipe(Schema.optional),
|
||||
files: Schema.Array(FileDiff).pipe(Schema.optional),
|
||||
})
|
||||
export type State = typeof State.Type
|
||||
partID: Schema.String.pipe(optional),
|
||||
snapshot: Schema.String.pipe(optional),
|
||||
diff: Schema.String.pipe(optional),
|
||||
files: Schema.Array(FileDiff).pipe(optional),
|
||||
}).annotate({ identifier: "Revert.State" })
|
||||
export interface State extends Schema.Schema.Type<typeof State> {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue