模板更新

This commit is contained in:
Xu Chang 2022-04-22 17:31:11 +08:00
parent d490a4596c
commit d66fe182ba
5 changed files with 22 additions and 10 deletions

6
template/.gitignore vendored
View File

@ -83,4 +83,8 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*
package-lock.json
src/wechatMp/dist
oak-app-domain

View File

@ -1,7 +1,7 @@
import { EntityDict } from 'oak-app-domain';
import { Feature } from 'oak-frontend-base';
import { Feature, BasicFeatures } from 'oak-frontend-base';
import { RuntimeContext } from 'oak-general-business';
import { AspectDict } from '../aspects';
import { Cache } from 'oak-frontend-base';
type DoSthAcion = {
type: 'doSth',
@ -10,16 +10,16 @@ type DoSthAcion = {
}
}
export class Sample extends Feature<EntityDict, AspectDict> {
export class Sample extends Feature<EntityDict, RuntimeContext<EntityDict>, AspectDict> {
get(params: any) {
throw new Error('Method not implemented.');
}
action(action: DoSthAcion) {
throw new Error('Method not implemented.');
}
cache: Cache<EntityDict, AspectDict>;
cache: BasicFeatures<EntityDict, RuntimeContext<EntityDict>, AspectDict>['cache'];
constructor(cache: Cache<EntityDict, AspectDict>) {
constructor(cache: BasicFeatures<EntityDict, RuntimeContext<EntityDict>, AspectDict>['cache']) {
super();
this.cache = cache;
};

View File

@ -1,9 +1,10 @@
import { EntityDict } from 'oak-app-domain';
import { BasicFeatures } from 'oak-frontend-base';
import { RuntimeContext } from 'oak-general-business'
import * as Sample from './Sample';
import { AspectDict } from '../aspects';
export function initialize(features: BasicFeatures<EntityDict, AspectDict>) {
export function initialize(features: BasicFeatures<EntityDict, RuntimeContext<EntityDict>, AspectDict>) {
const { cache } = features;
const sample = new Sample.Sample(cache);

View File

@ -1,12 +1,10 @@
import { OakPage, OakComponent } from './init'
import './init';
export interface IAppOption {
globalData: {};
}
App<IAppOption>({
globalData: {
OakPage,
OakComponent,
},
async onLaunch() {
console.log('onLaunch');

View File

@ -0,0 +1,9 @@
import { MakeOakComponent, MakeOakPage } from 'oak-frontend-base';
import { EntityDict } from 'oak-app-domain/EntityDict';
import { RuntimeContext, aspectDict } from 'oak-general-business';
declare global {
const OakPage: MakeOakPage<EntityDict, RuntimeContext<EntityDict>, typeof aspectDict, {}>;
const OakComponent: MakeOakComponent<EntityDict, RuntimeContext<EntityDict>, typeof aspectDict, {}>;
}
export {}