dothtml-interfaces 0.1.22 → 0.1.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dothtml-interfaces",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "Dependency injection interfaces for DOTHtml.",
5
5
  "main": "src/index.d.ts",
6
6
  "types": "src/index.d.ts",
package/src/i-dot.d.ts CHANGED
@@ -2,13 +2,13 @@
2
2
  import IComponent, { FrameworkItems } from "./i-component";
3
3
  import IDotCss, { IDotcssProp } from "./i-dot-css";
4
4
  import IEventBus from "./i-event-bus";
5
- import IObservable from "./i-observable";
5
+ import IReactive from "./i-reactive";
6
6
 
7
7
  type DotContentPrimitive = string|number|boolean;
8
8
  type DotContentBasic = DotContentPrimitive|Node|Element|NodeList|IComponent|IDotDocument//typeof DotDocument;
9
- export type DotContent = DotContentBasic|Array<DotContent>|IObservable;//|(()=>DotContent);
9
+ export type DotContent = DotContentBasic|Array<DotContent>|IReactive;//|(()=>DotContent);
10
10
 
11
- type AttrVal<T = string|number|boolean> = T|IObservable<T>;
11
+ type AttrVal<T = string|number|boolean> = T|IReactive<T>;
12
12
 
13
13
  /**
14
14
  * Global interface containing elements.
@@ -24,7 +24,7 @@ export interface IDotDocument
24
24
  /**
25
25
  * A conditional function, analogous to if. Renders the specified DOT if a condition is met. Dynamic binding is possible when condition and callback are functions.
26
26
  */
27
- when(condition:IObservable|boolean, DotContent): IDotConditionalDocument;
27
+ when(condition:IReactive|boolean, DotContent): IDotConditionalDocument;
28
28
 
29
29
  // Main functions.
30
30
  // TODO: please make this into a test case.
@@ -45,11 +45,11 @@ export interface IDotDocument
45
45
  /**
46
46
  * Creates a generic HTML node that can render a string, HTML nodes, or dotHTML content.
47
47
  */
48
- html(content: string|number|boolean|IObservable): IDotDocument;
48
+ html(content: string|number|boolean|IReactive): IDotDocument;
49
49
  /**
50
50
  * Creates a text node that will render as a string, rather than being parsed as markup.
51
51
  */
52
- text(content: string|number|boolean|IObservable): IDotDocument;
52
+ text(content: string|number|boolean|IReactive): IDotDocument;
53
53
  /**
54
54
  * Mounts a component.
55
55
  */
@@ -61,7 +61,7 @@ export interface IDotDocument
61
61
  */
62
62
  iterate(n: number, callback: (i: number)=>DotContent): IDotDocument;
63
63
  each<T>(a: Array<T>|{[key: string|number]: T}, callback: (x: T, i: number, k: string|number)=>DotContent): IDotDocument;
64
- each<T>(a: IObservable<any, Array<T>|{[key: string|number]: T}>, callback: (x: T, i: IObservable<number>, k: string|number)=>DotContent): IDotDocument;
64
+ each<T>(a: IReactive<any, Array<T>|{[key: string|number]: T}>, callback: (x: T, i: IReactive<number>, k: string|number)=>DotContent): IDotDocument;
65
65
 
66
66
  /**
67
67
  * Removes the targeted document and everything in it.
@@ -239,7 +239,7 @@ export interface IDotCore extends IDotDocument
239
239
  bus: IEventBus;
240
240
  window: IDotWindowBuilder;
241
241
 
242
- observe<Ti = IObservable|Array<any>|{[key: string|number]: any}|string|number|boolean, To = Ti>(props?: {value: Ti, key?: string, transformer?: (value: Ti)=>To}): IObservable<Ti, To>;
242
+ watch<Ti = IReactive|Array<any>|{[key: string|number]: any}|string|number|boolean, To = Ti>(props?: {value: Ti, key?: string, transformer?: (value: Ti)=>To}): IReactive<Ti, To>;
243
243
 
244
244
  component<T extends IComponent>(ComponentClass: new(...args: any[])=>T): (new(...args: any[])=>(T&{readonly $:FrameworkItems}));
245
245
  }
@@ -253,7 +253,7 @@ export interface IDotConditionalDocument extends IDotDocument{
253
253
  * A conditional catch, analogous to else if. Can be used after a when function. Evaluates if the previous when's condition was false.
254
254
  * Renders the specified DOT if a condition is met. Dynamic binding is possible when condition and callback are functions.
255
255
  */
256
- otherwiseWhen(condition:IObservable|boolean, callback: DotContent): IDotConditionalDocument;
256
+ otherwiseWhen(condition:IReactive|boolean, callback: DotContent): IDotConditionalDocument;
257
257
  /**
258
258
  * A conditional final catch, analogous to else. Can be used after a when or otherwiseWhen function. Evaluates if the previous when/otherwiseWhen evaluated to false.
259
259
  * Renders the specified DOT if a condition is met. Dynamic binding is possible when callback is a function.
@@ -824,7 +824,7 @@ interface IDotTrack extends IDotElementDocument<IDotTrack>{
824
824
  }
825
825
  interface IDotVideo extends IDotElementDocument<IDotVideo>{
826
826
  autoPlay(value: AttrVal<boolean>): IDotVideo;
827
- buffered(value: IObservable<unknown>): IDotVideo; // Managed by browser not user. TODO: we can possibly use events to update observable objects.
827
+ buffered(value: IReactive<unknown>): IDotVideo; // Managed by browser not user. TODO: we can possibly use events to update observable objects.
828
828
  controls(value: AttrVal<boolean>): IDotVideo;
829
829
  crossOrigin(value: AttrVal<"anonymous">|AttrVal<"use-credentials">): IDotVideo;
830
830
  height(value: AttrVal<number>): IDotVideo;
@@ -1,5 +1,5 @@
1
1
 
2
- export default interface IObservable<Ti = any, To = Ti>{
2
+ export default interface IReactive<Ti = any, To = Ti>{
3
3
  // The untransformed value.
4
4
  _value: Ti;
5
5
  // Get the value.
package/src/index.d.ts CHANGED
@@ -7,5 +7,5 @@ export * from "./i-dot-css";
7
7
 
8
8
  export { default as IComponent, FrameworkItems } from "./i-component";
9
9
 
10
- export { default as IObservable } from "./i-observable";
10
+ export { default as IObservable } from "./i-reactive";
11
11
  export { default as IEventBus } from "./i-event-bus";