@rallie/core
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -1,2 +0,2 @@ | ||
import { CustomCtxType, LifecyleCallbackType, DependencyType } from '../types'; | ||
import { LifecyleCallbackType, DependencyType, RelateType } from '../types'; | ||
export declare class App { | ||
@@ -6,4 +6,11 @@ name: string; | ||
bootstrapped: boolean; | ||
dependencies: DependencyType[]; | ||
relatedApps: CustomCtxType[]; | ||
dependencies: Array<{ | ||
name: string; | ||
ctx?: Record<string, any>; | ||
data?: any; | ||
}>; | ||
relatedApps: Array<{ | ||
name: string; | ||
ctx?: Record<string, any>; | ||
}>; | ||
doBootstrap?: LifecyleCallbackType; | ||
@@ -19,3 +26,3 @@ doActivate?: LifecyleCallbackType; | ||
*/ | ||
relateTo(relatedApps: CustomCtxType[]): this; | ||
relateTo(relatedApps: RelateType[]): this; | ||
/** | ||
@@ -41,4 +48,4 @@ * indicate the apps to be started before your app is bootstrapped | ||
onDestroy(callback: LifecyleCallbackType): this; | ||
activateDependenciesApp(activateApp: (ctx: CustomCtxType, data?: any) => Promise<void>): Promise<void>; | ||
loadRelatedApps(loadApp: (ctx: CustomCtxType) => Promise<void>): Promise<void>; | ||
activateDependenciesApp(activateApp: (name: string, data?: any, ctx?: Record<string, any>) => Promise<void>): Promise<void>; | ||
loadRelatedApps(loadApp: (name: string, ctx?: Record<string, any>) => Promise<void>): Promise<void>; | ||
} |
import { Socket } from './socket'; | ||
import { App } from './app'; | ||
import { MiddlewareFnType, ConfType, CustomCtxType } from '../types'; | ||
import { MiddlewareFnType, ConfType } from '../types'; | ||
export declare class Bus { | ||
@@ -56,13 +56,13 @@ private name; | ||
*/ | ||
loadApp(ctx: CustomCtxType): Promise<void>; | ||
loadApp(name: string, ctx?: Record<string, any>): Promise<void>; | ||
/** | ||
* activate an app | ||
* @param name | ||
* @param config | ||
* @param data | ||
*/ | ||
activateApp<T = any>(ctx: CustomCtxType, config?: T): Promise<void>; | ||
activateApp<T = any>(name: string, data?: T, ctx?: Record<string, any>): Promise<void>; | ||
/** | ||
* destroy an app | ||
* @param name | ||
* @param config | ||
* @param data | ||
*/ | ||
@@ -69,0 +69,0 @@ destroyApp<T = any>(name: string, data?: T): Promise<void>; |
@@ -1,2 +0,2 @@ | ||
import { MiddlewareFnType, NextFnType, ContextType, CustomCtxType, DependencyType } from '../types'; | ||
import { MiddlewareFnType, NextFnType, ContextType, DependencyType, RelateType } from '../types'; | ||
export declare const Errors: { | ||
@@ -23,3 +23,2 @@ removeNonExistedBroadcast: (eventName: string) => string; | ||
wrongMiddlewareType: () => string; | ||
wrongContextType: () => string; | ||
}; | ||
@@ -30,8 +29,4 @@ export declare const Warnings: { | ||
}; | ||
export declare function isObject(object: unknown): boolean; | ||
export declare function isPrimitive(object: unknown): boolean; | ||
export declare function getNameFromCtx(ctx: CustomCtxType): string; | ||
export declare function getNameFromDependency(dependency: DependencyType): string; | ||
export declare function getDeduplicatedRelatedApps(relatedApps: CustomCtxType[]): CustomCtxType[]; | ||
export declare function getDeduplicatedDependencies(dependencies: DependencyType[]): DependencyType[]; | ||
export declare function deduplicate(items: DependencyType[] | RelateType[]): any[]; | ||
/** | ||
@@ -38,0 +33,0 @@ * the compose function copied from koa-compose |
@@ -18,3 +18,2 @@ import { Socket } from './lib/socket'; | ||
name: string; | ||
libraryName?: string; | ||
loadScript: (script: ScriptType) => Promise<void>; | ||
@@ -27,7 +26,2 @@ loadLink: (link: LinkType) => void; | ||
}; | ||
export declare type CustomCtxType = { | ||
name: string; | ||
libraryName?: string; | ||
[key: string]: any; | ||
} | string; | ||
export declare type NextFnType = (ctx?: ContextType) => void | Promise<void>; | ||
@@ -37,5 +31,10 @@ export declare type MiddlewareFnType = (ctx: ContextType, next: NextFnType) => void | Promise<void>; | ||
export declare type DependencyType = { | ||
ctx: CustomCtxType; | ||
name: string; | ||
data?: any; | ||
ctx?: Record<string, any>; | ||
} | string; | ||
export declare type RelateType = { | ||
name: string; | ||
ctx: Record<string, any>; | ||
} | string; | ||
export declare type StoreType<T = any> = { | ||
@@ -42,0 +41,0 @@ state: T; |
{ | ||
"name": "@rallie/core", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "a progressive micro front framework", | ||
@@ -28,3 +28,3 @@ "main": "./dist/index.umd.js", | ||
"homepage": "https://github.com/ralliejs/rallie#readme", | ||
"gitHead": "8be5247aeedca969023dd6d3854b4075abc614a1" | ||
"gitHead": "97ad8a63ef22f61aeb42404288da57c00b3f0cd3" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
167342
4124