Merge pull request #58 from Flow-Works/ThinLiquid-patch-1
[🔨] Organize types
This commit is contained in:
commit
165514635e
1 changed files with 51 additions and 40 deletions
91
src/types.ts
91
src/types.ts
|
|
@ -1,7 +1,11 @@
|
||||||
import { FlowWindow } from './wm'
|
import { FlowWindow } from './wm'
|
||||||
|
|
||||||
export interface PackageJSON {
|
/* EVENTS */
|
||||||
version: string
|
|
||||||
|
export interface AppClosedEvent extends CustomEvent {
|
||||||
|
detail: {
|
||||||
|
win: FlowWindow
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AppOpenedEvent extends CustomEvent {
|
export interface AppOpenedEvent extends CustomEvent {
|
||||||
|
|
@ -11,6 +15,47 @@ export interface AppOpenedEvent extends CustomEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* METADATA */
|
||||||
|
|
||||||
|
export interface BaseMeta {
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
pkg: string
|
||||||
|
version: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AppMeta extends BaseMeta {
|
||||||
|
icon: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PluginMeta extends BaseMeta {
|
||||||
|
icon?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/* OBJECTS */
|
||||||
|
|
||||||
|
export interface Apps {
|
||||||
|
[key: string]: App
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Plugins {
|
||||||
|
[key: string]: Plugin
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MAIN INTERFACES */
|
||||||
|
|
||||||
|
export interface App {
|
||||||
|
meta: AppMeta
|
||||||
|
open: (data: any) => Promise<FlowWindow>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Plugin {
|
||||||
|
meta: PluginMeta
|
||||||
|
run: (element: HTMLDivElement) => void | Promise<void>
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MISC */
|
||||||
|
|
||||||
export interface FlowPlugin {
|
export interface FlowPlugin {
|
||||||
name: string
|
name: string
|
||||||
pkg: string
|
pkg: string
|
||||||
|
|
@ -23,12 +68,6 @@ export interface FlowPlugin {
|
||||||
loadTheme: (data: any) => void | Promise<void>
|
loadTheme: (data: any) => void | Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AppClosedEvent extends CustomEvent {
|
|
||||||
detail: {
|
|
||||||
win: FlowWindow
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FlowWindowConfig {
|
export interface FlowWindowConfig {
|
||||||
title: string
|
title: string
|
||||||
icon: string
|
icon: string
|
||||||
|
|
@ -42,38 +81,6 @@ export interface FlowWindowConfig {
|
||||||
minHeight?: number
|
minHeight?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface App {
|
|
||||||
meta: {
|
|
||||||
name: string
|
|
||||||
description: string
|
|
||||||
pkg: string
|
|
||||||
version: string
|
|
||||||
icon: string
|
|
||||||
}
|
|
||||||
|
|
||||||
open: (data: any) => Promise<FlowWindow>
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Plugin {
|
|
||||||
meta: {
|
|
||||||
name: string
|
|
||||||
description: string
|
|
||||||
pkg: string
|
|
||||||
version: string
|
|
||||||
icon?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
run: (element: HTMLDivElement) => void | Promise<void>
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Apps {
|
|
||||||
[key: string]: App
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Plugins {
|
|
||||||
[key: string]: Plugin
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface LoadedApp extends App {
|
export interface LoadedApp extends App {
|
||||||
builtin: boolean
|
builtin: boolean
|
||||||
}
|
}
|
||||||
|
|
@ -81,3 +88,7 @@ export interface LoadedApp extends App {
|
||||||
export interface LoadedPlugin extends Plugin {
|
export interface LoadedPlugin extends Plugin {
|
||||||
builtin: boolean
|
builtin: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PackageJSON {
|
||||||
|
version: string
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue