oksy 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oksy",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "The OKSY framework",
5
5
  "main": "library.js",
6
6
  "typings": "./types/src/library.pub.d.ts",
@@ -1,7 +1,7 @@
1
1
  import { Database } from './../../ReactiveStore/ReactiveStore';
2
2
  import { WebSocketServerClient } from './../../Server/Socket/WebSocketServerClient';
3
3
  import { watch as VueWatch, WatchStopHandle } from 'vue';
4
- import { BaseUser, BaseWorkspace } from '../../ReactiveStore/BaseEntity';
4
+ import { BaseFile, BaseUser, BaseWorkspace } from '../../ReactiveStore/BaseEntity';
5
5
  import { UI } from './UI';
6
6
  export declare abstract class BasePage {
7
7
  authUser: BaseUser;
@@ -16,7 +16,7 @@ export declare abstract class BasePage {
16
16
  state: {
17
17
  [key: string]: any;
18
18
  };
19
- UI: UI;
19
+ UI: UI<BaseFile>;
20
20
  constructor(authUser: BaseUser, database: Database, workspace: BaseWorkspace, client: WebSocketServerClient, visitedUrl: string);
21
21
  watch(...args: Parameters<typeof VueWatch>): void;
22
22
  }
@@ -10,14 +10,12 @@ export type FileType = {
10
10
  onRenameId: string;
11
11
  classInit: string;
12
12
  };
13
- type FileOptions = {
14
- onUpload: (file: BaseFile) => void;
15
- onDelete: (file: BaseFile) => void;
16
- files?: () => BaseFile[];
17
- class?: string;
18
- disabled?: FlatOrFunc<() => boolean>;
13
+ export declare function UseFile<TFile extends BaseFile>(page: BasePage): {
14
+ File: (options: {
15
+ onUpload: (file: TFile) => void;
16
+ onDelete: (file: TFile) => void;
17
+ files?: (() => TFile[]) | undefined;
18
+ class?: string | undefined;
19
+ disabled?: FlatOrFunc<() => boolean> | undefined;
20
+ }) => FileType;
19
21
  };
20
- export declare function UseFile(page: BasePage): {
21
- File: (options: FileOptions) => FileType;
22
- };
23
- export {};
@@ -1,5 +1,6 @@
1
1
  import { BasePage } from 'oksy';
2
- export declare class UI {
2
+ import { BaseFile } from 'oksy';
3
+ export declare class UI<TFile extends BaseFile> {
3
4
  Button: (options: {
4
5
  label: import("./Components/FlatOrFunc").FlatOrFunc<() => string>;
5
6
  onClick: () => void;
@@ -28,9 +29,9 @@ export declare class UI {
28
29
  items: () => any[];
29
30
  }) => import("./Components/Container").ContainerType;
30
31
  File: (options: {
31
- onUpload: (file: import("oksy").BaseFile) => void;
32
- onDelete: (file: import("oksy").BaseFile) => void;
33
- files?: (() => import("oksy").BaseFile[]) | undefined;
32
+ onUpload: (file: TFile) => void;
33
+ onDelete: (file: TFile) => void;
34
+ files?: (() => TFile[]) | undefined;
34
35
  class?: string | undefined;
35
36
  disabled?: import("./Components/FlatOrFunc").FlatOrFunc<() => boolean> | undefined;
36
37
  }) => import("./Components/File").FileType;
@@ -117,9 +118,9 @@ export declare class UI {
117
118
  class?: string | undefined;
118
119
  items: () => any[];
119
120
  }) => import("./Components/Container").ContainerType, File?: (options: {
120
- onUpload: (file: import("oksy").BaseFile) => void;
121
- onDelete: (file: import("oksy").BaseFile) => void;
122
- files?: (() => import("oksy").BaseFile[]) | undefined;
121
+ onUpload: (file: TFile) => void;
122
+ onDelete: (file: TFile) => void;
123
+ files?: (() => TFile[]) | undefined;
123
124
  class?: string | undefined;
124
125
  disabled?: import("./Components/FlatOrFunc").FlatOrFunc<() => boolean> | undefined;
125
126
  }) => import("./Components/File").FileType, SelectOne?: (options: {
@@ -32,7 +32,7 @@ declare abstract class BasePage {
32
32
  state: {
33
33
  [key: string]: any;
34
34
  };
35
- UI: UI;
35
+ UI: UI<MODULES.File>;
36
36
  authUser: MODULES.User;
37
37
  database: Database;
38
38
  workspace: MODULES.Workspace;