feat: auto generate tauri ipc interfaces

This commit is contained in:
Lin Onetwo 2023-01-05 14:53:39 +08:00
parent 20002785e9
commit 55f8f910fa
6 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,61 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "IBlobParameters",
"oneOf": [
{
"type": "object",
"required": ["Put"],
"properties": {
"Put": {
"$ref": "#/definitions/PutBlob"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": ["Get"],
"properties": {
"Get": {
"$ref": "#/definitions/GetBlob"
}
},
"additionalProperties": false
}
],
"definitions": {
"GetBlob": {
"type": "object",
"required": ["id", "workspace_id"],
"properties": {
"id": {
"type": "string"
},
"workspace_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
},
"PutBlob": {
"type": "object",
"required": ["blob", "workspace_id"],
"properties": {
"blob": {
"type": "array",
"items": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
},
"workspace_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
}
}

View File

@ -0,0 +1,25 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type IBlobParameters =
| {
Put: PutBlob;
}
| {
Get: GetBlob;
};
export interface PutBlob {
blob: number[];
workspace_id: number;
[k: string]: unknown;
}
export interface GetBlob {
id: string;
workspace_id: number;
[k: string]: unknown;
}

View File

@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "YDocumentUpdate",
"type": "object",
"required": ["room", "update"],
"properties": {
"room": {
"type": "string"
},
"update": {
"type": "array",
"items": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
}
}
}

View File

@ -0,0 +1,12 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface YDocumentUpdate {
room: string;
update: number[];
[k: string]: unknown;
}

View File

@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CreateWorkspace",
"type": "object",
"required": ["avatar", "id", "name"],
"properties": {
"avatar": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
}
}

View File

@ -0,0 +1,13 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface CreateWorkspace {
avatar: string;
id: number;
name: string;
[k: string]: unknown;
}