feat: add basic tauri client app

This commit is contained in:
Lin Onetwo
2023-01-04 17:16:26 +08:00
parent 87451a19bb
commit 64ca6a6b35
57 changed files with 12747 additions and 54 deletions

View File

@@ -0,0 +1,23 @@
/**
* Copied from packages/data-services/src/sdks/workspace.ts
* // TODO: after it published, use that package
*/
export enum WorkspaceType {
Private = 0,
Normal = 1,
}
export enum PermissionType {
Read = 0,
Write = 1,
Admin = 2,
Owner = 3,
}
export interface Workspace {
avatar: string;
id: number;
create_at: number;
name: string;
permission_type: PermissionType;
public: boolean;
type: WorkspaceType;
}

View File

@@ -0,0 +1,11 @@
// TODO: find official typings if available
type IsolationPayload = unknown;
declare global {
interface Window {
CLIENT_APP?: boolean;
__TAURI_ISOLATION_HOOK__: (payload: IsolationPayload) => IsolationPayload;
}
}
export {};

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 {
[k: string]: unknown;
blob: number[];
workspace_id: number;
}
export interface GetBlob {
[k: string]: unknown;
id: string;
workspace_id: number;
}

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 {
[k: string]: unknown;
room: string;
update: number[];
}

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 {
[k: string]: unknown;
avatar: string;
id: number;
name: string;
}