@rallie/block
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -1,6 +0,6 @@ | ||
import type { CallbackType, Socket } from '@rallie/core'; | ||
import type { Socket } from '@rallie/core'; | ||
export type BlockService = { | ||
state?: Record<string, any>; | ||
events?: Record<string, CallbackType>; | ||
methods?: Record<string, CallbackType>; | ||
events?: Record<string, Function>; | ||
methods?: Record<string, Function>; | ||
exports?: Record<string, any>; | ||
@@ -14,3 +14,2 @@ }; | ||
methods: T['methods']; | ||
isCreatedBlock: boolean; | ||
constructor(name: string); | ||
@@ -17,0 +16,0 @@ setState(action: string, setter: (state: T['state']) => void | Promise<void>): Promise<void>; |
import { Block, BlockService } from './block'; | ||
export declare class ConnectedBlock<T extends BlockService> extends Block<T> { | ||
private innerMethods; | ||
symbol: symbol; | ||
constructor(name: string); | ||
import(): T["exports"]; | ||
} |
@@ -18,9 +18,9 @@ import { ConnectedBlock } from './connected-block'; | ||
exports: T['exports']; | ||
symbol: symbol; | ||
constructor(name: string, globalBus: Bus, globalSocket: Socket, isEntry: boolean); | ||
addMethods(methods: Partial<T['methods']>): (eventName?: string) => void; | ||
connect<P extends BlockService>(name: string): ConnectedBlock<P>; | ||
load(name: string, ctx?: Record<string, any>): Promise<void>; | ||
activate<P>(name: string, data?: P, ctx?: Record<string, any>): Promise<void>; | ||
destroy<P>(name: string, data?: P): Promise<void>; | ||
load(name: string): Promise<void>; | ||
activate(name: string): Promise<void>; | ||
run(callback: (env: Env) => void | Promise<void>): Promise<void>; | ||
} |
@@ -10,2 +10,2 @@ import { CreatedBlock } from './created-block'; | ||
export type { RegisteredBlock } from './registered-block'; | ||
export type { CallbackType, ScriptType, LinkType, AssetsConfigType, ConfType, ContextType, NextFnType, MiddlewareFnType, LifecyleCallbackType, DependencyType, RelateType, Bus, } from '@rallie/core'; | ||
export type { ScriptType, LinkType, AssetsConfigType, ConfType, ContextType, NextFnType, MiddlewareFnType, Bus, } from '@rallie/core'; |
@@ -1,2 +0,1 @@ | ||
import { LifecyleCallbackType, RelateType, DependencyType } from '@rallie/core'; | ||
import { CreatedBlock } from './created-block'; | ||
@@ -10,9 +9,7 @@ export declare class RegisteredBlock<T extends CreatedBlock<unknown>> { | ||
constructor(createdBlock: T); | ||
relyOn(dependencies: DependencyType[]): this; | ||
relateTo(relatedApps: RelateType[]): this; | ||
relyOn(dependencies: string[]): this; | ||
relateTo(relatedApps: string[]): this; | ||
initState(state: T['state'], isPrivate?: boolean): this; | ||
export(exports: T['exports']): this; | ||
onBootstrap(callback: LifecyleCallbackType): this; | ||
onActivate(callback: LifecyleCallbackType): this; | ||
onDestroy(callback: LifecyleCallbackType): this; | ||
onActivate(callback: () => void | Promise<void>): this; | ||
} |
export type ConstraintedType<T, P, Default> = T extends P ? T : Default; | ||
export declare const symbols: { | ||
createdBlock: symbol; | ||
connectedBlock: symbol; | ||
export declare const SYMBOLS: { | ||
CREATED_BLOCK: symbol; | ||
CONNECTED_BLOCK: symbol; | ||
}; | ||
@@ -17,2 +17,3 @@ export declare const constant: { | ||
stateIsReadonly: (blockName: string) => string; | ||
operateBeforeRegister: (blockName: string, operate: 'activate' | 'load') => string; | ||
}; | ||
@@ -19,0 +20,0 @@ export declare const warnings: { |
{ | ||
"name": "@rallie/block", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "a progressive micro front framework", | ||
@@ -17,3 +17,3 @@ "main": "./dist/index.umd.js", | ||
"dependencies": { | ||
"@rallie/core": "0.12.0" | ||
"@rallie/core": "0.13.0" | ||
}, | ||
@@ -28,3 +28,3 @@ "repository": { | ||
"homepage": "https://github.com/ralliejs/rallie#readme", | ||
"gitHead": "bc6d9465958937011c312f9680d9c8190f081e1b" | ||
"gitHead": "3b989f55f96104c39eb8f2b2c4af0d82df09cf43" | ||
} |
Sorry, the diff of this file is too big to display
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
261349
6165
+ Added@rallie/core@0.13.0(transitive)
- Removed@rallie/core@0.12.0(transitive)
Updated@rallie/core@0.13.0