You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@lightningtv/core

Package Overview
Dependencies
Maintainers
0
Versions
197
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightningtv/core - npm Package Compare versions

Comparing version

to
0.1.1

7

dist/src/config.d.ts

@@ -12,11 +12,4 @@ import type { AnimationSettings, RendererMainSettings } from '@lightningjs/renderer';

}
declare global {
interface ImportMeta {
env: {
DEV: boolean;
};
}
}
export declare const isDev: boolean;
export declare const Config: Config;
export {};

6

dist/src/elementNode.d.ts

@@ -5,3 +5,3 @@ import { createShader } from './lightningInit.js';

import States, { type NodeStates } from './states.js';
import type { RendererMain, INode, INodeAnimatableProps, INodeWritableProps, ShaderRef, Dimensions, AnimationSettings } from '@lightningjs/renderer';
import type { RendererMain, INode, INodeAnimatableProps, INodeWritableProps, ShaderRef, Dimensions, AnimationSettings, IAnimationController } from '@lightningjs/renderer';
export type Styles = {

@@ -56,4 +56,4 @@ [key: string]: NodeStyles | TextStyles | undefined;

set shader(shaderProps: Parameters<typeof createShader> | ShaderRef);
_sendToLightningAnimatable(name: string, value: number | string): import("@lightningjs/renderer").IAnimationController | undefined;
animate(props: Partial<INodeAnimatableProps>, animationSettings?: Partial<AnimationSettings>): import("@lightningjs/renderer").IAnimationController;
_sendToLightningAnimatable(name: string, value: number): IAnimationController | undefined;
animate(props: Partial<INodeAnimatableProps>, animationSettings?: Partial<AnimationSettings>): IAnimationController;
chain(props: Partial<INodeAnimatableProps>, animationSettings?: Partial<AnimationSettings>): this;

@@ -60,0 +60,0 @@ start(): Promise<void>;

@@ -134,3 +134,14 @@ import { renderer, createShader } from './lightningInit.js';

: this.transition[name];
return this.animate({ [name]: value }, animationSettings).start();
const controller = this.animate({ [name]: value }, animationSettings);
if (isFunc(this.onAnimationStarted)) {
controller.once('animating', () => {
this.onAnimationStarted?.call(this, name, value);
});
}
if (isFunc(this.onAnimationStarted)) {
controller.once('finished', () => {
this.onAnimationStarted?.call(this, name, value);
});
}
return controller.start();
}

@@ -137,0 +148,0 @@ this.lng[name] = value;

@@ -50,2 +50,4 @@ import { type AnimationSettings, type Dimensions, type FadeOutEffectProps, type GlitchEffectProps, type GrayscaleEffectProps, type INode, type INodeWritableProps, type ITextNodeWritableProps, type LinearGradientEffectProps, type NodeFailedPayload, type NodeLoadedPayload, type RadialGradientEffectProps, type RadialProgressEffectProps } from '@lightningjs/renderer';

onLayout?: (this: ElementNode, target: ElementNode, child?: ElementNode, dimensions?: Dimensions) => void;
onAnimationStarted?: (key: string, value: number) => void;
onAnimationFinished?: (key: string, value: number) => void;
forwardFocus?: number | ((this: ElementNode, elm: ElementNode) => boolean | void);

@@ -52,0 +54,0 @@ ref?: ElementNode | ((node: ElementNode) => void) | undefined;

{
"name": "@lightningtv/core",
"version": "0.1.0",
"version": "0.1.1",
"description": "Lightning TV Core for Universal Renderers",

@@ -51,6 +51,7 @@ "type": "module",

"typescript": "^5.5.2",
"typescript-eslint": "^7.13.1"
"typescript-eslint": "^7.13.1",
"vite": "^5.3.1"
},
"peerDependencies": {
"@lightningjs/renderer": "^0.9.0"
"@lightningjs/renderer": "^0.9.4"
},

@@ -57,0 +58,0 @@ "lint-staged": {

@@ -17,11 +17,2 @@ import type {

declare global {
interface ImportMeta {
env: {
DEV: boolean;
// Add other environment variables here if needed
};
}
}
function isDevEnv(): boolean {

@@ -28,0 +19,0 @@ return !!(import.meta.env && import.meta.env.DEV);

@@ -39,2 +39,3 @@ import { renderer, createShader } from './lightningInit.js';

ITextNodeWritableProps,
IAnimationController,
} from '@lightningjs/renderer';

@@ -227,3 +228,3 @@ import { assertTruthy } from '@lightningjs/renderer/utils';

_sendToLightningAnimatable(name: string, value: number | string) {
_sendToLightningAnimatable(name: string, value: number) {
if (

@@ -240,3 +241,17 @@ this.transition &&

return this.animate({ [name]: value }, animationSettings).start();
const controller = this.animate({ [name]: value }, animationSettings);
if (isFunc(this.onAnimationStarted)) {
controller.once('animating', () => {
this.onAnimationStarted?.call(this, name, value);
});
}
if (isFunc(this.onAnimationStarted)) {
controller.once('finished', () => {
this.onAnimationStarted?.call(this, name, value);
});
}
return controller.start();
}

@@ -250,3 +265,3 @@

animationSettings?: Partial<AnimationSettings>,
) {
): IAnimationController {
assertTruthy(this.rendered, 'Node must be rendered before animating');

@@ -253,0 +268,0 @@ return (this.lng as INode).animate(

@@ -82,2 +82,4 @@ import {

) => void;
onAnimationStarted?: (key: string, value: number) => void;
onAnimationFinished?: (key: string, value: number) => void;
forwardFocus?:

@@ -84,0 +86,0 @@ | number

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet