Socket
Socket
Sign inDemoInstall

@appsemble/sdk

Package Overview
Dependencies
Maintainers
4
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appsemble/sdk - npm Package Compare versions

Comparing version 0.11.4 to 0.11.5

113

dist/index.d.ts
import { Promisable } from 'type-fest';
/**
* Actions defined on a block.
*
* If a block uses actions, extend this interface using module augmentation. The keys are the names
* of the events the block supports.
*
* @example
* declare module '<at>appsemble/sdk' {
* interface Actions {
* onClick: {}
* }
* }
*/
export interface Actions {
}
/**
* Event emitters defined on a block.
*
* If a block emits events, extend this interface using module augmentation. The keys are the names
* of the events the block can emit.
*
* @example
* declare module '<at>appsemble/sdk' {
* interface EventEmitters {
* data: {}
* }
* }
*/
export interface EventEmitters {
}
/**
* Event listeners defined on a block.
*
* If a block listens on events, extend this interface using module augmentation. The keys are the
* names of the events the block can emit.
*
* @example
* declare module '<at>appsemble/sdk' {
* interface EventListeners {
* data: {}
* }
* }
*/
export interface EventListeners {
}
/**
* Custom free form parameters defined on a block.
*
* If a block listens on events, extend this interface using module augmentation. The keys are the
* names of the events the block can emit.
*
* @example
* declare module '<at>appsemble/sdk' {
* interface Parameters {
* param1: string;
* param2: number;
* param3: {
* nested: boolean;
* }
* }
* }
*/
export interface Parameters {
}
export declare type BodyHTTPMethodsUpper = 'PATCH' | 'POST' | 'PUT';

@@ -73,3 +137,3 @@ /**

*/
export interface Block<P = any, A = {}, E extends EventParams = Required<EventParams>> {
export interface Block {
/**

@@ -105,3 +169,3 @@ * The type of the block.

*/
parameters?: P;
parameters?: Parameters;
/**

@@ -112,3 +176,3 @@ * A mapping of actions that can be fired by the block to action handlers.

*/
actions?: A;
actions?: Actions;
/**

@@ -120,4 +184,8 @@ * Mapping of the events the block can listen to and emit.

events?: {
listen: Record<E['listen'], string>;
emit: Record<E['emit'], string>;
listen: {
[K in keyof EventListeners]: string;
};
emit: {
[K in keyof EventEmitters]: string;
};
};

@@ -189,5 +257,2 @@ /**

}
export declare type Actions<A> = {
[K in keyof A]: Action;
};
export interface PageParameters {

@@ -208,5 +273,3 @@ [parameter: string]: string;

}
export declare type EventEmitters<E extends EventParams> = Record<E['emit'], (data: any, error?: string) => void>;
export declare type EventListeners<E extends EventParams> = Record<E['listen'], (callback: (data: any, error?: string) => void) => void>;
export interface Events<E extends EventParams = {}> {
export interface Events {
/**

@@ -218,3 +281,5 @@ * Emit an Appsemble event.

*/
emit: EventEmitters<E>;
emit: {
[K in keyof EventEmitters]: (data: any, error?: string) => void;
};
/**

@@ -226,3 +291,5 @@ * Remove an event listener for an Appsemble event.

*/
off: EventListeners<E>;
off: {
[K in keyof EventListeners]: (callback: (data: any, error?: string) => void) => void;
};
/**

@@ -234,3 +301,5 @@ * Add an event listener for an Appsemble event.

*/
on: EventListeners<E>;
on: {
[K in keyof EventListeners]: (callback: (data: any, error?: string) => void) => void;
};
}

@@ -240,11 +309,13 @@ /**

*/
export interface BootstrapParams<P = any, A = {}, E extends EventParams = {}> {
export interface BootstrapParams {
/**
* The actions that may be dispatched by the block.
*/
actions: Actions<A>;
actions: {
[K in keyof Actions]: Action;
};
/**
* The block as it is defined in the app definition.
*/
block: Block<P, A, E>;
block: Block;
/**

@@ -257,3 +328,3 @@ * Any kind of data that has been passed in by some context.

*/
events: Events<E>;
events: Events;
/**

@@ -284,3 +355,3 @@ * URL parameters of the current route.

*/
export declare type BootstrapFunction<P = any, A = {}, E extends EventParams = {}> = (params: BootstrapParams<P, A, E>) => Promisable<void>;
export declare type BootstrapFunction = (params: BootstrapParams) => Promisable<void>;
/**

@@ -300,3 +371,3 @@ * @private

*/
export declare function bootstrap<P = any, A = {}, E extends EventParams = {}>(fn: BootstrapFunction<P, A, E>): void;
export declare function bootstrap(fn: BootstrapFunction): void;
/**

@@ -310,2 +381,2 @@ * Attach the returned node to the shadow root.

*/
export declare function attach<P = any, A = {}, E extends EventParams = {}>(fn: (params: BootstrapParams<P, A, E>) => Promisable<HTMLElement | void>): void;
export declare function attach(fn: (params: BootstrapParams) => Promisable<HTMLElement | void>): void;
{
"name": "@appsemble/sdk",
"version": "0.11.4",
"version": "0.11.5",
"homepage": "https://appsemble.dev",
"bugs": {
"url": "https://gitlab.com/appsemble/appsemble/issues"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/appsemble/appsemble.git",
"directory": "packages/sdk"
},
"license": "LGPL-3.0-or-later",
"author": "Appsemble <info@appsemble.com> (https://appsemble.com)",
"files": [
"dist"
],
"main": "src",
"browser": "dist",
"types": "dist",
"scripts": {

@@ -9,0 +21,0 @@ "prepack": "tsc -p tsconfig.build.json"

src/index.test.ts
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc