dothtml-interfaces 0.1.34 → 0.1.36

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/i-dot.d.ts +15 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dothtml-interfaces",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
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
@@ -225,6 +225,13 @@ export interface IDotDocument
225
225
  wbr(content?: DotContent): IDotElementDocument<IDotGenericElement>;
226
226
  }
227
227
 
228
+ type Styles = string|((css: IDotCss) => IDotcssProp|string);
229
+ interface IComponentFactory {
230
+ <T extends IComponent>(Base: new (...args: Parameters<T['build']>) => T, styles?: Styles[]): new (...args: Parameters<T['build']>) => T;
231
+ useStyles<T extends IComponent>(styles: Styles): (Base: new (...args: Parameters<T['build']>) => T) => new (...args: Parameters<T['build']>) => T;
232
+ }
233
+
234
+
228
235
  /**
229
236
  * Interface for the dot object.
230
237
  */
@@ -233,16 +240,21 @@ export interface IDotCore extends IDotDocument
233
240
  (targetSelector: string|Element|Node|NodeList|Array<Node|Element>): IDotElementDocument<IDotGenericElement>;
234
241
 
235
242
  version: string;
243
+ styleMode: "sync"|"async";
236
244
 
237
245
  navigate(path: string, noHistory?: boolean, force?: boolean): void;
238
246
  css: IDotCss;
239
247
  bus: IEventBus;
240
- window: IDotWindowBuilder;
248
+ // window: IDotWindowBuilder;
241
249
 
242
250
  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
251
 
244
- component<T extends IComponent>(Base: new (...args: Parameters<T['build']>) => T): new (...args: Parameters<T['build']>) => T;
245
- useStyles<T extends IComponent>(styles: string|((css: IDotCss)=>IDotcssProp|string)): ((Base: new (...args: Parameters<T['build']>) => T) => new (...args: Parameters<T['build']>) => T);
252
+ // Keep these around for a bit to show how it was done before in case I need to change anything prior to the v6 launch.
253
+ // component<T extends IComponent>(Base: new (...args: Parameters<T['build']>) => T): new (...args: Parameters<T['build']>) => T;
254
+ // useStyles<T extends IComponent>(styles: string|((css: IDotCss)=>IDotcssProp|string)): ((Base: new (...args: Parameters<T['build']>) => T) => new (...args: Parameters<T['build']>) => T);
255
+
256
+ component: IComponentFactory;
257
+ useStyles(document: Document, styles: Styles): HTMLStyleElement;
246
258
  }
247
259
 
248
260
  export interface IDotWindowBuilder{