Socket
Book a DemoInstallSign in
Socket

@lcem/unified-view-generator

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lcem/unified-view-generator - npm Package Compare versions

Comparing version

to
0.10.1

60

dist/index.d.ts

@@ -1,24 +0,1 @@

export interface Slots<C> {
[name: string]: (C & Indexable)[];
}
export interface Indexable {
key: string;
}
export interface MayContainOtherComponents<C> {
slots?: Slots<C>;
}
export interface Properties {
[name: string]: any;
}
export interface ComponentDefinition<C> {
create(properties: Properties, slots?: Slots<C>): C;
}
export declare type ComponentInstances = Slots<LWCComponentInstance>;
export interface LWCComponentInstance extends MayContainOtherComponents<LWCComponentInstance> {
descriptor: string;
properties: Properties;
slots?: ComponentInstances;
key?: string;
}
export declare type KeyedLWCComponentInstance = LWCComponentInstance & Indexable;
export type JSONSchemaMetaSchema = Schema | boolean;

@@ -104,2 +81,7 @@ export interface Schema {

export type View = Component;
export interface View2 {
definition: string;
attributes?: Record<string, JsonValue>;
children?: View2[];
}
export interface DataProviderInstance {

@@ -111,9 +93,35 @@ getData(): JsonValue;

}
export interface Slots<C> {
[name: string]: (C & Indexable)[];
}
export interface Indexable {
key: string;
}
export interface MayContainOtherComponents<C> {
slots?: Slots<C>;
}
export interface Properties {
[name: string]: any;
}
export interface ComponentDefinition<C> {
create(properties: Properties, slots?: Slots<C>): C;
}
export declare type ComponentInstances = Slots<LWCComponentInstance>;
export interface LWCComponentInstance extends MayContainOtherComponents<LWCComponentInstance> {
descriptor: string;
properties: Properties;
slots?: ComponentInstances;
key?: string;
}
export declare type KeyedLWCComponentInstance = LWCComponentInstance & Indexable;
/**
* Given a piece of UEM, asynchronously convert it to the generic shape C passed in.
*/
export interface ComponentResolver<C extends MayContainOtherComponents<C>> {
resolve(component: Component): Promise<ComponentDefinition<C> | null>;
resolve(component: Component | View2): Promise<ComponentDefinition<C> | null>;
}
export declare class ComponentResolverChain<C> implements ComponentResolver<C> {
export declare class ComponentResolverChain<C extends MayContainOtherComponents<C>> implements ComponentResolver<C> {
private readonly resolvers;
constructor(resolvers: ComponentResolver<C>[]);
resolve(component: Component): Promise<ComponentDefinition<C> | null>;
resolve(component: Component | View2): Promise<ComponentDefinition<C> | null>;
}

@@ -120,0 +128,0 @@ export interface UiGenerationResult<C extends MayContainOtherComponents<C>> {

@@ -49,5 +49,2 @@ import { ViewReducer, isExpression, extract } from '@lcem/unified-view-model';

}
getChildrenReducer() {
return undefined;
}
async reduce(context, definition, properties, regions) {

@@ -54,0 +51,0 @@ const componentDefinition = await this.resolver.resolve({ definition, properties });

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "0.10.0",
"version": "0.10.1",
"main": "dist/index.js",

@@ -25,7 +25,9 @@ "types": "dist/index.d.ts",

"test": "jest",
"test:update": "jest --updateSnapshot",
"test:coverage": "jest --coverage"
},
"dependencies": {
"@lcem/unified-view-model": "0.10.0"
"@lcem/meta-schemas": "0.10.1",
"@lcem/unified-view-model": "0.10.1"
}
}
SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.