@lightningjs/blits 1.8.2 → 1.8.3
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 +9 -1
- package/index.d.ts +23 -23
- package/package.json +1 -1
- package/src/lib/codegenerator/generator.test.js +633 -609
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.8.3
|
|
4
|
+
|
|
5
|
+
_31 oct 2024_
|
|
6
|
+
|
|
7
|
+
- Exported TS interfaces and improved return type of before route hook
|
|
8
|
+
- Fixed test cases for codegenerator
|
|
9
|
+
|
|
10
|
+
|
|
3
11
|
## v1.8.2
|
|
4
12
|
|
|
5
13
|
_30 oct 2024_
|
|
6
14
|
|
|
7
|
-
- Fixed
|
|
15
|
+
- Fixed edge case issue with array based props not triggering reactivity
|
|
8
16
|
|
|
9
17
|
|
|
10
18
|
## v1.8.1
|
package/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {type ShaderEffect as RendererShaderEffect, type WebGlCoreShader} from '@
|
|
|
19
19
|
|
|
20
20
|
declare module '@lightningjs/blits' {
|
|
21
21
|
|
|
22
|
-
interface Hooks {
|
|
22
|
+
export interface Hooks {
|
|
23
23
|
/**
|
|
24
24
|
* Fires when the Component is being instantiated
|
|
25
25
|
* At this moment child elements will not be available yet
|
|
@@ -77,7 +77,7 @@ declare module '@lightningjs/blits' {
|
|
|
77
77
|
exit?: () => void;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
interface Input {
|
|
80
|
+
export interface Input {
|
|
81
81
|
[key: string]: (event: KeyboardEvent) => void | undefined,
|
|
82
82
|
/**
|
|
83
83
|
* Catch all input function
|
|
@@ -88,7 +88,7 @@ declare module '@lightningjs/blits' {
|
|
|
88
88
|
any?: (event: KeyboardEvent) => void
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
interface Log {
|
|
91
|
+
export interface Log {
|
|
92
92
|
/**
|
|
93
93
|
* Log an info message
|
|
94
94
|
*/
|
|
@@ -109,16 +109,16 @@ declare module '@lightningjs/blits' {
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
interface RouteData {
|
|
112
|
+
export interface RouteData {
|
|
113
113
|
[key: string]: any
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// todo: specify valid route options
|
|
117
|
-
interface RouteOptions {
|
|
117
|
+
export interface RouteOptions {
|
|
118
118
|
[key: string]: any
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
interface Router {
|
|
121
|
+
export interface Router {
|
|
122
122
|
/**
|
|
123
123
|
* Navigate to a different location
|
|
124
124
|
*
|
|
@@ -148,7 +148,7 @@ declare module '@lightningjs/blits' {
|
|
|
148
148
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
type ComponentBase = {
|
|
151
|
+
export type ComponentBase = {
|
|
152
152
|
/**
|
|
153
153
|
* Listen to events emitted by other components
|
|
154
154
|
*/
|
|
@@ -246,7 +246,7 @@ declare module '@lightningjs/blits' {
|
|
|
246
246
|
/**
|
|
247
247
|
* Prop object
|
|
248
248
|
*/
|
|
249
|
-
type PropObject = {
|
|
249
|
+
export type PropObject = {
|
|
250
250
|
/**
|
|
251
251
|
* Name of the prop
|
|
252
252
|
*/
|
|
@@ -274,7 +274,7 @@ declare module '@lightningjs/blits' {
|
|
|
274
274
|
};
|
|
275
275
|
|
|
276
276
|
// Props Array
|
|
277
|
-
type Props = (string | PropObject)[];
|
|
277
|
+
export type Props = (string | PropObject)[];
|
|
278
278
|
|
|
279
279
|
// Extract the prop names from the props array
|
|
280
280
|
type ExtractPropNames<P extends Props> = {
|
|
@@ -282,11 +282,11 @@ declare module '@lightningjs/blits' {
|
|
|
282
282
|
};
|
|
283
283
|
|
|
284
284
|
// Update the PropsDefinition to handle props as strings or objects
|
|
285
|
-
type PropsDefinition<P extends Props> = ExtractPropNames<P>;
|
|
285
|
+
export type PropsDefinition<P extends Props> = ExtractPropNames<P>;
|
|
286
286
|
|
|
287
|
-
type ComponentContext<P extends Props, S, M, C> = ThisType<PropsDefinition<P> & S & M & C & ComponentBase>
|
|
287
|
+
export type ComponentContext<P extends Props, S, M, C> = ThisType<PropsDefinition<P> & S & M & C & ComponentBase>
|
|
288
288
|
|
|
289
|
-
interface ComponentConfig<P extends Props, S, M, C, W> {
|
|
289
|
+
export interface ComponentConfig<P extends Props, S, M, C, W> {
|
|
290
290
|
components?: {
|
|
291
291
|
[key: string]: ComponentFactory,
|
|
292
292
|
},
|
|
@@ -365,7 +365,7 @@ declare module '@lightningjs/blits' {
|
|
|
365
365
|
watch?: W & ComponentContext<P, S, M, C>
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
interface ApplicationConfig<P extends Props, S, M, C, W> extends ComponentConfig<P, S, M, C, W> {
|
|
368
|
+
export interface ApplicationConfig<P extends Props, S, M, C, W> extends ComponentConfig<P, S, M, C, W> {
|
|
369
369
|
/**
|
|
370
370
|
* Routes definition
|
|
371
371
|
*
|
|
@@ -383,7 +383,7 @@ declare module '@lightningjs/blits' {
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
|
|
386
|
-
interface Transition {
|
|
386
|
+
export interface Transition {
|
|
387
387
|
/**
|
|
388
388
|
* Name of the prop to transition (i.e. 'x', 'y', 'alpha', 'color')
|
|
389
389
|
*/
|
|
@@ -406,7 +406,7 @@ declare module '@lightningjs/blits' {
|
|
|
406
406
|
delay?: number
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
interface Before {
|
|
409
|
+
export interface Before {
|
|
410
410
|
/**
|
|
411
411
|
* Name of the prop to set before the transition starts
|
|
412
412
|
*/
|
|
@@ -417,7 +417,7 @@ declare module '@lightningjs/blits' {
|
|
|
417
417
|
value: any,
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
interface RouteTransition {
|
|
420
|
+
export interface RouteTransition {
|
|
421
421
|
/**
|
|
422
422
|
* Setting or Array of Settings before new view enters into the router view
|
|
423
423
|
*/
|
|
@@ -432,9 +432,9 @@ declare module '@lightningjs/blits' {
|
|
|
432
432
|
out: Transition | Transition[],
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
-
type RouteTransitionFunction = (previousRoute: Route, currentRoute: Route) => RequireAtLeastOne<RouteTransition>
|
|
435
|
+
export type RouteTransitionFunction = (previousRoute: Route, currentRoute: Route) => RequireAtLeastOne<RouteTransition>
|
|
436
436
|
|
|
437
|
-
interface RouteAnnounce {
|
|
437
|
+
export interface RouteAnnounce {
|
|
438
438
|
/**
|
|
439
439
|
* Message to be announced
|
|
440
440
|
*/
|
|
@@ -447,15 +447,15 @@ declare module '@lightningjs/blits' {
|
|
|
447
447
|
politeness?: 'off' | 'polite' | 'assertive'
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
type RequireAtLeastOne<T> = {
|
|
450
|
+
export type RequireAtLeastOne<T> = {
|
|
451
451
|
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>
|
|
452
452
|
}[keyof T]
|
|
453
453
|
|
|
454
|
-
interface RouteHooks {
|
|
455
|
-
before?: (to: Route, from: Route) => string | Route
|
|
454
|
+
export interface RouteHooks {
|
|
455
|
+
before?: (to: Route, from: Route) => string | Route | Promise<string | Route>;
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
type Route = {
|
|
458
|
+
export type Route = {
|
|
459
459
|
/**
|
|
460
460
|
* URI path for the route
|
|
461
461
|
*/
|
|
@@ -575,7 +575,7 @@ declare module '@lightningjs/blits' {
|
|
|
575
575
|
* Launcher function that sets up the Lightning renderer and instantiates
|
|
576
576
|
* the Blits App
|
|
577
577
|
*/
|
|
578
|
-
interface Settings {
|
|
578
|
+
export interface Settings {
|
|
579
579
|
/**
|
|
580
580
|
* Width of the Application
|
|
581
581
|
*/
|