fullts
Version:
Full stack framework in TypeScript, based on TSRPC.
46 lines (45 loc) • 1.38 kB
TypeScript
import FulltsAppConfig from './FulltsAppConfig';
import { ITsrpcClient, TsrpcPtl } from 'tsrpc-protocol';
import SuperPromise from 'k8w-super-promise';
import TsrpcClient from 'tsrpc-browser';
import { RouteComponentProps } from 'react-router-dom';
import 'k8w-extend-native';
export default class FulltsApp implements ITsrpcClient {
rpcClient: TsrpcClient;
readonly config: FulltsAppConfig;
/**
* params from route match
*/
params: any;
/**
* params from parse query string
*/
query: {
[key: string]: string;
};
history: RouteComponentProps<any>['history'];
location: RouteComponentProps<any>['location'];
match: RouteComponentProps<any>['match'];
constructor(config: FulltsAppConfig);
protected _apiRequests: {
[sn: number]: SuperPromise<any>;
};
callApi<Req, Res>(ptl: TsrpcPtl<Req, Res>, req?: Req): SuperPromise<Res>;
protected _domTarget?: HTMLElement;
renderTo(domTarget: HTMLElement): void;
dispose(): void;
cancelAllApiRequest(): void;
/**
* 设置页面标题
* @param title
*/
setTitle(title: string): void;
/**
* 设置SEO用到的Meta信息
* @param meta
*/
setSeoMeta(meta: {
keywords: string[] | null;
description: string | null;
}): void;
}