Skip to content

Commit

Permalink
chore: exported EffectsProps interfaces (#152)
Browse files Browse the repository at this point in the history
fixes: [93](#93)
  • Loading branch information
frank-weindel authored Feb 7, 2024
2 parents afc1466 + 16d293b commit 622f927
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
9 changes: 9 additions & 0 deletions exports/main-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ export * from '../src/common/CommonTypes.js';
export type { TextRendererMap } from '../src/core/text-rendering/renderers/TextRenderer.js';
export type { TrFontFaceMap } from '../src/core/text-rendering/font-face-types/TrFontFace.js';
export type { AnimationSettings } from '../src/core/animations/CoreAnimation.js';
export type {
EffectProps,
FadeOutEffectProps,
LinearGradientEffectProps,
RadialGradientEffectProps,
GrayscaleEffectProps,
GlitchEffectProps,
RadialProgressEffectProps,
} from '../src/core/CoreShaderManager.js';
45 changes: 39 additions & 6 deletions src/core/CoreShaderManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,42 @@ import { SdfShader } from './renderers/webgl/shaders/SdfShader.js';

import { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';
import { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';
import { LinearGradientEffect } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';
import { GrayscaleEffect } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';
import {
LinearGradientEffect,
type LinearGradientEffectProps,
} from './renderers/webgl/shaders/effects/LinearGradientEffect.js';
import {
GrayscaleEffect,
type GrayscaleEffectProps,
} from './renderers/webgl/shaders/effects/GrayscaleEffect.js';
import { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';
import { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';
import { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';
import { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';
import { GlitchEffect } from './renderers/webgl/shaders/effects/GlitchEffect.js';
import { FadeOutEffect } from './renderers/webgl/shaders/effects/FadeOutEffect.js';
import { RadialGradientEffect } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';
import {
GlitchEffect,
type GlitchEffectProps,
} from './renderers/webgl/shaders/effects/GlitchEffect.js';
import {
FadeOutEffect,
type FadeOutEffectProps,
} from './renderers/webgl/shaders/effects/FadeOutEffect.js';
import {
RadialGradientEffect,
type RadialGradientEffectProps,
} from './renderers/webgl/shaders/effects/RadialGradientEffect.js';
import type { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';
import { RadialProgressEffect } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';
import {
RadialProgressEffect,
type RadialProgressEffectProps,
} from './renderers/webgl/shaders/effects/RadialProgressEffect.js';

export type { FadeOutEffectProps };
export type { LinearGradientEffectProps };
export type { RadialGradientEffectProps };
export type { GrayscaleEffectProps };
export type { GlitchEffectProps };
export type { RadialProgressEffectProps };

export interface ShaderMap {
DefaultShader: typeof DefaultShader;
Expand Down Expand Up @@ -71,6 +96,14 @@ export interface EffectMap {
radialProgress: typeof RadialProgressEffect;
}

export type EffectProps =
| FadeOutEffectProps
| LinearGradientEffectProps
| RadialGradientEffectProps
| GrayscaleEffectProps
| GlitchEffectProps
| RadialProgressEffectProps;

export class CoreShaderManager {
protected shCache: Map<string, InstanceType<ShaderMap[keyof ShaderMap]>> =
new Map();
Expand Down

0 comments on commit 622f927

Please sign in to comment.