Package of overFlow has been changed.
This commit is contained in:
13
src/ts/@overflow/commons/api/Client.ts
Normal file
13
src/ts/@overflow/commons/api/Client.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
class Client {
|
||||
private wss: WebSocket;
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface Protocol {
|
||||
serviceName: string;
|
||||
methodName: string;
|
||||
params?: string[];
|
||||
}
|
||||
|
||||
export default Client;
|
||||
15
src/ts/@overflow/commons/api/Service.ts
Normal file
15
src/ts/@overflow/commons/api/Service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
abstract class Service {
|
||||
private name: string;
|
||||
protected constructor(name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
protected send(methodName: string, ...params: any[]): Promise<string> {
|
||||
return new Promise<string>(resolve => {
|
||||
resolve('');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default Service;
|
||||
17
src/ts/@overflow/commons/context/index.ts
Normal file
17
src/ts/@overflow/commons/context/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
class AppContext {
|
||||
private static context: AppContext;
|
||||
|
||||
private constructor() {
|
||||
|
||||
}
|
||||
|
||||
public static getService<T>(): T {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static getContext(): AppContext {
|
||||
return AppContext.context;
|
||||
}
|
||||
}
|
||||
|
||||
export default AppContext;
|
||||
14
src/ts/@overflow/commons/platform/index.ts
Normal file
14
src/ts/@overflow/commons/platform/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
abstract class Platform {
|
||||
|
||||
public static * getAppContainer(containerId: string): IterableIterator<Promise<HTMLElement>> {
|
||||
const appContainer = yield new Promise<HTMLElement>(resolve => {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
resolve(document.getElementById(containerId));
|
||||
});
|
||||
});
|
||||
|
||||
return appContainer;
|
||||
}
|
||||
}
|
||||
|
||||
export default Platform;
|
||||
8
src/ts/@overflow/commons/redux/Action.ts
Normal file
8
src/ts/@overflow/commons/redux/Action.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as Redux from 'redux';
|
||||
|
||||
interface Action<Payload = {}> extends Redux.Action {
|
||||
payload?: Payload;
|
||||
error?: Error;
|
||||
}
|
||||
|
||||
export default Action;
|
||||
Reference in New Issue
Block a user