@builder.io/sdk 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/index.browser.js +2726 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +38 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.esm.js +31 -26
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +40 -30
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +14 -11
- package/dist/src/builder.class.d.ts +862 -862
- package/dist/src/classes/animator.class.d.ts +26 -26
- package/dist/src/classes/cookies.class.d.ts +15 -15
- package/dist/src/classes/observable.class.d.ts +27 -26
- package/dist/src/classes/observable.class.js +9 -0
- package/dist/src/classes/observable.class.js.map +1 -1
- package/dist/src/classes/promise.class.d.ts +17 -17
- package/dist/src/classes/query-string.class.d.ts +9 -9
- package/dist/src/classes/query-string.class.test.d.ts +1 -1
- package/dist/src/constants/builder.d.ts +2 -2
- package/dist/src/functions/assign.function.d.ts +1 -1
- package/dist/src/functions/fetch.function.d.ts +28 -28
- package/dist/src/functions/finder.function.d.ts +10 -10
- package/dist/src/functions/get-top-level-domain.d.ts +6 -6
- package/dist/src/functions/next-tick.function.d.ts +2 -1
- package/dist/src/functions/omit.function.d.ts +1 -1
- package/dist/src/functions/server-only-require.function.d.ts +3 -3
- package/dist/src/functions/throttle.function.d.ts +1 -1
- package/dist/src/functions/to-error.d.ts +13 -13
- package/dist/src/functions/uuid.d.ts +8 -8
- package/dist/src/types/api-version.d.ts +2 -2
- package/dist/src/types/content.d.ts +31 -31
- package/dist/src/types/element.d.ts +60 -60
- package/dist/src/url.d.ts +9 -9
- package/dist/src/url.test.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -9
- package/project.json +4 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export interface AnimationStep {
|
|
2
|
-
styles: {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
};
|
|
5
|
-
delay?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface Animation {
|
|
8
|
-
elementId: string;
|
|
9
|
-
trigger: string;
|
|
10
|
-
steps: AnimationStep[];
|
|
11
|
-
duration: number;
|
|
12
|
-
delay?: number;
|
|
13
|
-
easing?: string;
|
|
14
|
-
id?: string;
|
|
15
|
-
repeat?: boolean;
|
|
16
|
-
thresholdPercent?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare class Animator {
|
|
19
|
-
bindAnimations(animations: Animation[]): void;
|
|
20
|
-
private warnElementNotPresent;
|
|
21
|
-
private augmentAnimation;
|
|
22
|
-
private getAllStylesUsed;
|
|
23
|
-
triggerAnimation(animation: Animation): void;
|
|
24
|
-
bindHoverAnimation(animation: Animation): void;
|
|
25
|
-
bindScrollInViewAnimation(animation: Animation): void;
|
|
26
|
-
}
|
|
1
|
+
export interface AnimationStep {
|
|
2
|
+
styles: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
delay?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Animation {
|
|
8
|
+
elementId: string;
|
|
9
|
+
trigger: string;
|
|
10
|
+
steps: AnimationStep[];
|
|
11
|
+
duration: number;
|
|
12
|
+
delay?: number;
|
|
13
|
+
easing?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
repeat?: boolean;
|
|
16
|
+
thresholdPercent?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class Animator {
|
|
19
|
+
bindAnimations(animations: Animation[]): void;
|
|
20
|
+
private warnElementNotPresent;
|
|
21
|
+
private augmentAnimation;
|
|
22
|
+
private getAllStylesUsed;
|
|
23
|
+
triggerAnimation(animation: Animation): void;
|
|
24
|
+
bindHoverAnimation(animation: Animation): void;
|
|
25
|
+
bindScrollInViewAnimation(animation: Animation): void;
|
|
26
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="@types/node" />
|
|
2
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
-
interface Options {
|
|
4
|
-
secure?: boolean;
|
|
5
|
-
expires?: Date;
|
|
6
|
-
}
|
|
7
|
-
declare class Cookies {
|
|
8
|
-
private request;
|
|
9
|
-
private response;
|
|
10
|
-
secure?: boolean;
|
|
11
|
-
constructor(request: IncomingMessage, response: ServerResponse);
|
|
12
|
-
get(name: string): string | undefined;
|
|
13
|
-
set(name: string, value: string, opts: Options): this;
|
|
14
|
-
}
|
|
15
|
-
export default Cookies;
|
|
1
|
+
/// <reference types="@types/node" />
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
interface Options {
|
|
4
|
+
secure?: boolean;
|
|
5
|
+
expires?: Date;
|
|
6
|
+
}
|
|
7
|
+
declare class Cookies {
|
|
8
|
+
private request;
|
|
9
|
+
private response;
|
|
10
|
+
secure?: boolean;
|
|
11
|
+
constructor(request: IncomingMessage, response: ServerResponse);
|
|
12
|
+
get(name: string): string | undefined;
|
|
13
|
+
set(name: string, value: string, opts: Options): this;
|
|
14
|
+
}
|
|
15
|
+
export default Cookies;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
export type Listener<T> = (value: T) => void;
|
|
2
|
-
export declare class Subscription<FunctionType = Function> {
|
|
3
|
-
private listeners?;
|
|
4
|
-
private listener?;
|
|
5
|
-
constructor(listeners?: FunctionType[] | undefined, listener?: FunctionType | undefined);
|
|
6
|
-
unsubscribed: boolean;
|
|
7
|
-
get closed(): boolean;
|
|
8
|
-
private readonly otherSubscriptions;
|
|
9
|
-
add(subscription: Subscription): void;
|
|
10
|
-
unsubscribe(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare class BehaviorSubject<T = any, ErrorType = any> {
|
|
13
|
-
value: T;
|
|
14
|
-
constructor(value: T);
|
|
15
|
-
private listeners;
|
|
16
|
-
private errorListeners;
|
|
17
|
-
next(value: T): void;
|
|
18
|
-
map<NewType = any>(fn: (item: T) => NewType): BehaviorSubject<NewType, any>;
|
|
19
|
-
catch(errorListener: Listener<ErrorType>): Subscription<Listener<ErrorType>>;
|
|
20
|
-
error(error: ErrorType): void;
|
|
21
|
-
subscribe(listener: Listener<T>, errorListener?: Listener<ErrorType>): Subscription<Listener<T>>;
|
|
22
|
-
toPromise(): Promise<T>;
|
|
23
|
-
promise(): Promise<T>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare const
|
|
1
|
+
export type Listener<T> = (value: T) => void;
|
|
2
|
+
export declare class Subscription<FunctionType = Function> {
|
|
3
|
+
private listeners?;
|
|
4
|
+
private listener?;
|
|
5
|
+
constructor(listeners?: FunctionType[] | undefined, listener?: FunctionType | undefined);
|
|
6
|
+
unsubscribed: boolean;
|
|
7
|
+
get closed(): boolean;
|
|
8
|
+
private readonly otherSubscriptions;
|
|
9
|
+
add(subscription: Subscription): void;
|
|
10
|
+
unsubscribe(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class BehaviorSubject<T = any, ErrorType = any> {
|
|
13
|
+
value: T;
|
|
14
|
+
constructor(value: T);
|
|
15
|
+
private listeners;
|
|
16
|
+
private errorListeners;
|
|
17
|
+
next(value: T): void;
|
|
18
|
+
map<NewType = any>(fn: (item: T) => NewType): BehaviorSubject<NewType, any>;
|
|
19
|
+
catch(errorListener: Listener<ErrorType>): Subscription<Listener<ErrorType>>;
|
|
20
|
+
error(error: ErrorType): void;
|
|
21
|
+
subscribe(listener: Listener<T>, errorListener?: Listener<ErrorType>): Subscription<Listener<T>>;
|
|
22
|
+
toPromise(): Promise<T>;
|
|
23
|
+
promise(): Promise<T>;
|
|
24
|
+
then: Promise<T>['then'];
|
|
25
|
+
}
|
|
26
|
+
export declare const Observer: typeof BehaviorSubject;
|
|
27
|
+
export declare const Observable: typeof BehaviorSubject;
|
|
@@ -37,9 +37,18 @@ exports.Subscription = Subscription;
|
|
|
37
37
|
// TODO: follow minimal basic spec: https://github.com/tc39/proposal-observable
|
|
38
38
|
var BehaviorSubject = /** @class */ (function () {
|
|
39
39
|
function BehaviorSubject(value) {
|
|
40
|
+
var _this = this;
|
|
40
41
|
this.value = value;
|
|
41
42
|
this.listeners = [];
|
|
42
43
|
this.errorListeners = [];
|
|
44
|
+
this.then = function () {
|
|
45
|
+
var _a;
|
|
46
|
+
var args = [];
|
|
47
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
48
|
+
args[_i] = arguments[_i];
|
|
49
|
+
}
|
|
50
|
+
return (_a = _this.toPromise()).then.apply(_a, args);
|
|
51
|
+
};
|
|
43
52
|
}
|
|
44
53
|
BehaviorSubject.prototype.next = function (value) {
|
|
45
54
|
this.value = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.class.js","sourceRoot":"","sources":["../../../src/classes/observable.class.ts"],"names":[],"mappings":";;;AAEA;IACE,sBAAoB,SAA0B,EAAU,QAAuB;QAA3D,cAAS,GAAT,SAAS,CAAiB;QAAU,aAAQ,GAAR,QAAQ,CAAe;QAE/E,iBAAY,GAAG,KAAK,CAAC;QAMJ,uBAAkB,GAAmB,EAAE,CAAC;IARyB,CAAC;IAInF,sBAAI,gCAAM;aAAV;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAID,0BAAG,GAAH,UAAI,YAA0B;QAC5B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAED,kCAAW,GAAX;QACE,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,OAAO;SACR;QACD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;YACnC,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACpD,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;gBACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;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_handlers;
|
|
4
|
-
private _value;
|
|
5
|
-
constructor(executor: (resolve: (val: T) => any, reject: (err: T) => any) => void);
|
|
6
|
-
private _resolve;
|
|
7
|
-
private _fulfill;
|
|
8
|
-
private _reject;
|
|
9
|
-
private _isPending;
|
|
10
|
-
private _isFulfilled;
|
|
11
|
-
private _isRejected;
|
|
12
|
-
private _addHandler;
|
|
13
|
-
private _callHandler;
|
|
14
|
-
then(onFulfilled: (val: T) => any, onRejected: (err: any) => any): TinyPromise<any> | undefined;
|
|
15
|
-
}
|
|
16
|
-
declare const _default: PromiseConstructor;
|
|
17
|
-
export default _default;
|
|
1
|
+
export declare class TinyPromise<T = any> {
|
|
2
|
+
private _state;
|
|
3
|
+
private _handlers;
|
|
4
|
+
private _value;
|
|
5
|
+
constructor(executor: (resolve: (val: T) => any, reject: (err: T) => any) => void);
|
|
6
|
+
private _resolve;
|
|
7
|
+
private _fulfill;
|
|
8
|
+
private _reject;
|
|
9
|
+
private _isPending;
|
|
10
|
+
private _isFulfilled;
|
|
11
|
+
private _isRejected;
|
|
12
|
+
private _addHandler;
|
|
13
|
+
private _callHandler;
|
|
14
|
+
then(onFulfilled: (val: T) => any, onRejected: (err: any) => any): TinyPromise<any> | undefined;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: PromiseConstructor;
|
|
17
|
+
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type StringMap = Record<string, string>;
|
|
2
|
-
export declare class QueryString {
|
|
3
|
-
static parseDeep(queryString: string): any;
|
|
4
|
-
static stringifyDeep(obj: any): string;
|
|
5
|
-
static parse(queryString: string): StringMap;
|
|
6
|
-
static stringify(map: StringMap): string;
|
|
7
|
-
static deepen(map: StringMap): any;
|
|
8
|
-
static flatten(obj: any, _current?: any, _res?: any): StringMap;
|
|
9
|
-
}
|
|
1
|
+
export type StringMap = Record<string, string>;
|
|
2
|
+
export declare class QueryString {
|
|
3
|
+
static parseDeep(queryString: string): any;
|
|
4
|
+
static stringifyDeep(obj: any): string;
|
|
5
|
+
static parse(queryString: string): StringMap;
|
|
6
|
+
static stringify(map: StringMap): string;
|
|
7
|
+
static deepen(map: StringMap): any;
|
|
8
|
+
static flatten(obj: any, _current?: any, _res?: any): StringMap;
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Builder } from '../builder.class';
|
|
2
|
-
export declare const builder: Builder;
|
|
1
|
+
import { Builder } from '../builder.class';
|
|
2
|
+
export declare const builder: Builder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function assign(target: object, ...args: any[]): any;
|
|
1
|
+
export declare function assign(target: object, ...args: any[]): any;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export interface SimplifiedFetchOptions {
|
|
2
|
-
body?: string;
|
|
3
|
-
headers?: {
|
|
4
|
-
[key: string]: string;
|
|
5
|
-
};
|
|
6
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
7
|
-
credentials?: 'include';
|
|
8
|
-
mode?: RequestMode;
|
|
9
|
-
}
|
|
10
|
-
export interface SimpleFetchResponse {
|
|
11
|
-
ok: boolean;
|
|
12
|
-
status: number;
|
|
13
|
-
statusText: string;
|
|
14
|
-
url: string;
|
|
15
|
-
clone: () => any;
|
|
16
|
-
text: () => Promise<string>;
|
|
17
|
-
json: () => Promise<any>;
|
|
18
|
-
blob: () => Promise<Blob>;
|
|
19
|
-
headers: {
|
|
20
|
-
keys: () => string[];
|
|
21
|
-
entries: () => [string, string][];
|
|
22
|
-
get: (n: string) => string;
|
|
23
|
-
has: (n: string) => boolean;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
declare function tinyFetch(url: string, options?: SimplifiedFetchOptions): Promise<SimpleFetchResponse>;
|
|
27
|
-
export declare function getFetch(): typeof fetch | typeof tinyFetch;
|
|
28
|
-
export {};
|
|
1
|
+
export interface SimplifiedFetchOptions {
|
|
2
|
+
body?: string;
|
|
3
|
+
headers?: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
7
|
+
credentials?: 'include';
|
|
8
|
+
mode?: RequestMode;
|
|
9
|
+
}
|
|
10
|
+
export interface SimpleFetchResponse {
|
|
11
|
+
ok: boolean;
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
url: string;
|
|
15
|
+
clone: () => any;
|
|
16
|
+
text: () => Promise<string>;
|
|
17
|
+
json: () => Promise<any>;
|
|
18
|
+
blob: () => Promise<Blob>;
|
|
19
|
+
headers: {
|
|
20
|
+
keys: () => string[];
|
|
21
|
+
entries: () => [string, string][];
|
|
22
|
+
get: (n: string) => string;
|
|
23
|
+
has: (n: string) => boolean;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
declare function tinyFetch(url: string, options?: SimplifiedFetchOptions): Promise<SimpleFetchResponse>;
|
|
27
|
+
export declare function getFetch(): typeof fetch | typeof tinyFetch;
|
|
28
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type Options = {
|
|
2
|
-
root: Element;
|
|
3
|
-
idName: (name: string) => boolean;
|
|
4
|
-
className: (name: string) => boolean;
|
|
5
|
-
tagName: (name: string) => boolean;
|
|
6
|
-
seedMinLength: number;
|
|
7
|
-
optimizedMinLength: number;
|
|
8
|
-
threshold: number;
|
|
9
|
-
};
|
|
10
|
-
export default function (input: Element, options?: Partial<Options>): string;
|
|
1
|
+
export type Options = {
|
|
2
|
+
root: Element;
|
|
3
|
+
idName: (name: string) => boolean;
|
|
4
|
+
className: (name: string) => boolean;
|
|
5
|
+
tagName: (name: string) => boolean;
|
|
6
|
+
seedMinLength: number;
|
|
7
|
+
optimizedMinLength: number;
|
|
8
|
+
threshold: number;
|
|
9
|
+
};
|
|
10
|
+
export default function (input: Element, options?: Partial<Options>): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Only gets one level up from hostname
|
|
3
|
-
* wwww.example.com -> example.com
|
|
4
|
-
* www.example.co.uk -> example.co.uk
|
|
5
|
-
*/
|
|
6
|
-
export declare function getTopLevelDomain(host: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* Only gets one level up from hostname
|
|
3
|
+
* wwww.example.com -> example.com
|
|
4
|
+
* www.example.co.uk -> example.co.uk
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTopLevelDomain(host: string): string;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="@types/node" />
|
|
2
|
+
export declare function nextTick(fn: () => void): NodeJS.Immediate | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function omit<T extends object>(obj: T, ...values: (keyof T)[]): Partial<T>;
|
|
1
|
+
export declare function omit<T extends object>(obj: T, ...values: (keyof T)[]): Partial<T>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="@types/node" />
|
|
2
|
-
declare let serverOnlyRequire: NodeRequire;
|
|
3
|
-
export default serverOnlyRequire;
|
|
1
|
+
/// <reference types="@types/node" />
|
|
2
|
+
declare let serverOnlyRequire: NodeRequire;
|
|
3
|
+
export default serverOnlyRequire;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function throttle(func: Function, wait: number, options?: any): (this: any) => any;
|
|
1
|
+
export declare function throttle(func: Function, wait: number, options?: any): (this: any) => any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe conversion to error type. Intended to be used in catch blocks where the
|
|
3
|
-
* value is not guaranteed to be an error.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* try {
|
|
7
|
-
* throw new Error('Something went wrong')
|
|
8
|
-
* }
|
|
9
|
-
* catch (err: unknown) {
|
|
10
|
-
* const error: Error = toError(err)
|
|
11
|
-
* }
|
|
12
|
-
*/
|
|
13
|
-
export declare function toError(err: unknown): Error;
|
|
1
|
+
/**
|
|
2
|
+
* Safe conversion to error type. Intended to be used in catch blocks where the
|
|
3
|
+
* value is not guaranteed to be an error.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* try {
|
|
7
|
+
* throw new Error('Something went wrong')
|
|
8
|
+
* }
|
|
9
|
+
* catch (err: unknown) {
|
|
10
|
+
* const error: Error = toError(err)
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export declare function toError(err: unknown): Error;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @credit https://stackoverflow.com/a/2117523
|
|
3
|
-
*/
|
|
4
|
-
export declare function uuidv4(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Slightly cleaner and smaller UUIDs
|
|
7
|
-
*/
|
|
8
|
-
export declare function uuid(): string;
|
|
1
|
+
/**
|
|
2
|
+
* @credit https://stackoverflow.com/a/2117523
|
|
3
|
+
*/
|
|
4
|
+
export declare function uuidv4(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Slightly cleaner and smaller UUIDs
|
|
7
|
+
*/
|
|
8
|
+
export declare function uuid(): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type ApiVersion = 'v1' | 'v3';
|
|
2
|
-
export declare const DEFAULT_API_VERSION: ApiVersion;
|
|
1
|
+
export type ApiVersion = 'v1' | 'v3';
|
|
2
|
+
export declare const DEFAULT_API_VERSION: ApiVersion;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { Input } from '../builder.class';
|
|
2
|
-
import { BuilderElement } from './element';
|
|
3
|
-
export interface BuilderContentVariation {
|
|
4
|
-
data?: {
|
|
5
|
-
blocks?: BuilderElement[];
|
|
6
|
-
inputs?: Input[];
|
|
7
|
-
state?: {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
};
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
12
|
-
name?: string;
|
|
13
|
-
testRatio?: number;
|
|
14
|
-
id?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface BuilderContent extends BuilderContentVariation {
|
|
17
|
-
'@version'?: number;
|
|
18
|
-
id?: string;
|
|
19
|
-
name?: string;
|
|
20
|
-
published?: 'published' | 'draft' | 'archived';
|
|
21
|
-
modelId?: string;
|
|
22
|
-
priority?: number;
|
|
23
|
-
lastUpdated?: number;
|
|
24
|
-
startDate?: number;
|
|
25
|
-
endDate?: number;
|
|
26
|
-
variations?: {
|
|
27
|
-
[id: string]: BuilderContentVariation | undefined;
|
|
28
|
-
};
|
|
29
|
-
testVariationId?: string;
|
|
30
|
-
testVariationName?: string;
|
|
31
|
-
}
|
|
1
|
+
import { Input } from '../builder.class';
|
|
2
|
+
import { BuilderElement } from './element';
|
|
3
|
+
export interface BuilderContentVariation {
|
|
4
|
+
data?: {
|
|
5
|
+
blocks?: BuilderElement[];
|
|
6
|
+
inputs?: Input[];
|
|
7
|
+
state?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
name?: string;
|
|
13
|
+
testRatio?: number;
|
|
14
|
+
id?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BuilderContent extends BuilderContentVariation {
|
|
17
|
+
'@version'?: number;
|
|
18
|
+
id?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
published?: 'published' | 'draft' | 'archived';
|
|
21
|
+
modelId?: string;
|
|
22
|
+
priority?: number;
|
|
23
|
+
lastUpdated?: number;
|
|
24
|
+
startDate?: number;
|
|
25
|
+
endDate?: number;
|
|
26
|
+
variations?: {
|
|
27
|
+
[id: string]: BuilderContentVariation | undefined;
|
|
28
|
+
};
|
|
29
|
+
testVariationId?: string;
|
|
30
|
+
testVariationName?: string;
|
|
31
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
type JSONValue = string | number | boolean | JSONObject | JSONArray;
|
|
2
|
-
interface JSONObject {
|
|
3
|
-
[x: string]: JSONValue;
|
|
4
|
-
}
|
|
5
|
-
interface JSONArray extends Array<JSONValue> {
|
|
6
|
-
}
|
|
7
|
-
export type SerializableCSSStyleDeclaration = Partial<Record<keyof CSSStyleDeclaration, string>>;
|
|
8
|
-
/**
|
|
9
|
-
* An object representing an element in Builder
|
|
10
|
-
*/
|
|
11
|
-
export interface BuilderElement {
|
|
12
|
-
'@type': '@builder.io/sdk:Element';
|
|
13
|
-
'@version'?: number;
|
|
14
|
-
id?: string;
|
|
15
|
-
tagName?: string;
|
|
16
|
-
layerName?: string;
|
|
17
|
-
groupLocked?: boolean;
|
|
18
|
-
layerLocked?: boolean;
|
|
19
|
-
/** @deprecated @hidden */
|
|
20
|
-
class?: string;
|
|
21
|
-
children?: BuilderElement[];
|
|
22
|
-
responsiveStyles?: {
|
|
23
|
-
large?: SerializableCSSStyleDeclaration;
|
|
24
|
-
medium?: SerializableCSSStyleDeclaration;
|
|
25
|
-
small?: SerializableCSSStyleDeclaration;
|
|
26
|
-
/** @deprecated */
|
|
27
|
-
xsmall?: SerializableCSSStyleDeclaration;
|
|
28
|
-
};
|
|
29
|
-
component?: {
|
|
30
|
-
name: string;
|
|
31
|
-
options?: any;
|
|
32
|
-
tag?: string;
|
|
33
|
-
};
|
|
34
|
-
bindings?: {
|
|
35
|
-
[key: string]: string;
|
|
36
|
-
};
|
|
37
|
-
meta?: {
|
|
38
|
-
[key: string]: JSONValue;
|
|
39
|
-
};
|
|
40
|
-
actions?: {
|
|
41
|
-
[key: string]: string;
|
|
42
|
-
};
|
|
43
|
-
properties?: {
|
|
44
|
-
[key: string]: string;
|
|
45
|
-
};
|
|
46
|
-
code?: {
|
|
47
|
-
bindings?: {
|
|
48
|
-
[key: string]: string;
|
|
49
|
-
};
|
|
50
|
-
actions?: {
|
|
51
|
-
[key: string]: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
repeat?: {
|
|
55
|
-
collection: string;
|
|
56
|
-
itemName?: string;
|
|
57
|
-
} | null;
|
|
58
|
-
animations?: any[];
|
|
59
|
-
}
|
|
60
|
-
export {};
|
|
1
|
+
type JSONValue = string | number | boolean | JSONObject | JSONArray;
|
|
2
|
+
interface JSONObject {
|
|
3
|
+
[x: string]: JSONValue;
|
|
4
|
+
}
|
|
5
|
+
interface JSONArray extends Array<JSONValue> {
|
|
6
|
+
}
|
|
7
|
+
export type SerializableCSSStyleDeclaration = Partial<Record<keyof CSSStyleDeclaration, string>>;
|
|
8
|
+
/**
|
|
9
|
+
* An object representing an element in Builder
|
|
10
|
+
*/
|
|
11
|
+
export interface BuilderElement {
|
|
12
|
+
'@type': '@builder.io/sdk:Element';
|
|
13
|
+
'@version'?: number;
|
|
14
|
+
id?: string;
|
|
15
|
+
tagName?: string;
|
|
16
|
+
layerName?: string;
|
|
17
|
+
groupLocked?: boolean;
|
|
18
|
+
layerLocked?: boolean;
|
|
19
|
+
/** @deprecated @hidden */
|
|
20
|
+
class?: string;
|
|
21
|
+
children?: BuilderElement[];
|
|
22
|
+
responsiveStyles?: {
|
|
23
|
+
large?: SerializableCSSStyleDeclaration;
|
|
24
|
+
medium?: SerializableCSSStyleDeclaration;
|
|
25
|
+
small?: SerializableCSSStyleDeclaration;
|
|
26
|
+
/** @deprecated */
|
|
27
|
+
xsmall?: SerializableCSSStyleDeclaration;
|
|
28
|
+
};
|
|
29
|
+
component?: {
|
|
30
|
+
name: string;
|
|
31
|
+
options?: any;
|
|
32
|
+
tag?: string;
|
|
33
|
+
};
|
|
34
|
+
bindings?: {
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
};
|
|
37
|
+
meta?: {
|
|
38
|
+
[key: string]: JSONValue;
|
|
39
|
+
};
|
|
40
|
+
actions?: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
properties?: {
|
|
44
|
+
[key: string]: string;
|
|
45
|
+
};
|
|
46
|
+
code?: {
|
|
47
|
+
bindings?: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
};
|
|
50
|
+
actions?: {
|
|
51
|
+
[key: string]: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
repeat?: {
|
|
55
|
+
collection: string;
|
|
56
|
+
itemName?: string;
|
|
57
|
+
} | null;
|
|
58
|
+
animations?: any[];
|
|
59
|
+
}
|
|
60
|
+
export {};
|
package/dist/src/url.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="@types/node" />
|
|
2
|
-
import { UrlWithStringQuery } from 'url';
|
|
3
|
-
type Fix<T> = {
|
|
4
|
-
[P in keyof T]: T[P] | null;
|
|
5
|
-
};
|
|
6
|
-
export type UrlLike = Fix<UrlWithStringQuery>;
|
|
7
|
-
export declare function emptyUrl(): UrlLike;
|
|
8
|
-
export declare function parse(url: string): UrlLike;
|
|
9
|
-
export {};
|
|
1
|
+
/// <reference types="@types/node" />
|
|
2
|
+
import { UrlWithStringQuery } from 'url';
|
|
3
|
+
type Fix<T> = {
|
|
4
|
+
[P in keyof T]: T[P] | null;
|
|
5
|
+
};
|
|
6
|
+
export type UrlLike = Fix<UrlWithStringQuery>;
|
|
7
|
+
export declare function emptyUrl(): UrlLike;
|
|
8
|
+
export declare function parse(url: string): UrlLike;
|
|
9
|
+
export {};
|
package/dist/src/url.test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|