Skip to content

Instantly share code, notes, and snippets.

@johnrees
Created October 12, 2020 16:56
Show Gist options
  • Save johnrees/9d03db485596b2c32c4794a1e6e8c270 to your computer and use it in GitHub Desktop.
Save johnrees/9d03db485596b2c32c4794a1e6e8c270 to your computer and use it in GitHub Desktop.
export namespace OT {
export type path = Array<string | number>;
export namespace Object {
export interface Add {
p: OT.path;
oi: any;
}
export interface Remove {
p: OT.path;
od: any;
}
export interface Replace {
p: OT.path;
od: any;
oi: any;
}
}
export namespace Array {
export interface Add {
p: OT.path;
li: any;
}
export interface Remove {
p: OT.path;
ld: any;
}
export interface Replace {
p: OT.path;
ld: any;
li: any;
}
}
export type Op =
| OT.Object.Add
| OT.Object.Remove
| OT.Object.Replace
| OT.Array.Add
| OT.Array.Remove
| OT.Array.Replace;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment