@shopify/react-native-skia
Version:
High-performance React Native Graphics using Skia
136 lines (135 loc) • 10.9 kB
TypeScript
import { NodeType } from "../dom/types";
import type { DeclarationNode, FractalNoiseProps, RenderNode, CircleProps, DrawingNodeProps, ImageProps, PaintProps, PathProps, CustomDrawingNodeProps, LineProps, OvalProps, DiffRectProps, PointsProps, RectProps, RoundedRectProps, TextProps, VerticesProps, BlurMaskFilterProps, BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps, MatrixColorFilterProps, ShaderProps, ImageShaderProps, LinearGradientProps, GroupProps, PatchProps, BlendColorFilterProps, DashPathEffectProps, DiscretePathEffectProps, CornerPathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, BoxProps, BoxShadowProps, ParagraphProps } from "../dom/types";
import type { ChildrenProps } from "../dom/types/Common";
import type { BlendProps, MorphologyImageFilterProps } from "../dom/types/ImageFilters";
import type { SkRect, SkRRect } from "../skia/types";
import type { JsiDrawingNode } from "../dom/nodes/DrawingNode";
import type { SkiaValue } from "../values";
import type { Container } from "./Container";
import type { SkiaProps } from "./processors";
import type { DependencyManager } from "./DependencyManager";
export declare const NATIVE_DOM: boolean;
declare global {
var SkiaDomApi: {
DependencyManager: (registerValues: (values: Array<SkiaValue<unknown>>) => () => void) => DependencyManager;
RectNode: (props: RectProps) => JsiDrawingNode<RectProps, SkRect>;
RRectNode: (props: RoundedRectProps) => JsiDrawingNode<RoundedRectProps, SkRRect>;
GroupNode: (props: GroupProps) => RenderNode<GroupProps>;
PaintNode: (props: PaintProps) => DeclarationNode<PaintProps>;
FillNode: (props: PaintProps) => RenderNode<PaintProps>;
CircleNode: (props: CircleProps) => RenderNode<CircleProps>;
PathNode: (props: PathProps) => RenderNode<PathProps>;
CustomDrawingNode: (props: CustomDrawingNodeProps) => RenderNode<CustomDrawingNodeProps>;
LineNode: (props: LineProps) => RenderNode<LineProps>;
ImageNode: (props: ImageProps) => RenderNode<ImageProps>;
OvalNode: (props: OvalProps) => RenderNode<OvalProps>;
PatchNode: (props: PatchProps) => RenderNode<PatchProps>;
PointsNode: (props: PointsProps) => RenderNode<PointsProps>;
DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;
BlurMaskFilterNode: (props: BlurMaskFilterProps) => DeclarationNode<BlurMaskFilterProps>;
DashPathEffectNode: (props: DashPathEffectProps) => DeclarationNode<DashPathEffectProps>;
DiscretePathEffectNode: (props: DiscretePathEffectProps) => DeclarationNode<DiscretePathEffectProps>;
CornerPathEffectNode: (props: CornerPathEffectProps) => DeclarationNode<CornerPathEffectProps>;
Path1DPathEffectNode: (props: Path1DPathEffectProps) => DeclarationNode<Path1DPathEffectProps>;
Path2DPathEffectNode: (props: Path2DPathEffectProps) => DeclarationNode<Path2DPathEffectProps>;
Line2DPathEffectNode: (props: Line2DPathEffectProps) => DeclarationNode<Line2DPathEffectProps>;
SumPathEffectNode: () => DeclarationNode<null>;
BlendImageFilterNode: (props: BlendImageFilterProps) => DeclarationNode<BlendImageFilterProps>;
DropShadowImageFilterNode: (props: DropShadowImageFilterProps) => DeclarationNode<DropShadowImageFilterProps>;
DisplacementMapImageFilterNode: (props: DisplacementMapImageFilterProps) => DeclarationNode<DisplacementMapImageFilterProps>;
BlurImageFilterNode: (props: BlurImageFilterProps) => DeclarationNode<BlurImageFilterProps>;
OffsetImageFilterNode: (props: OffsetImageFilterProps) => DeclarationNode<OffsetImageFilterProps>;
MorphologyImageFilterNode: (props: MorphologyImageFilterProps) => DeclarationNode<MorphologyImageFilterProps>;
RuntimeShaderImageFilterNode: (props: RuntimeShaderImageFilterProps) => DeclarationNode<RuntimeShaderImageFilterProps>;
MatrixColorFilterNode: (props: MatrixColorFilterProps) => DeclarationNode<MatrixColorFilterProps>;
BlendColorFilterNode: (props: BlendColorFilterProps) => DeclarationNode<BlendColorFilterProps>;
LinearToSRGBGammaColorFilterNode: () => DeclarationNode<null>;
SRGBToLinearGammaColorFilterNode: () => DeclarationNode<null>;
LumaColorFilterNode: () => DeclarationNode<null>;
LerpColorFilterNode: (props: LerpColorFilterProps) => DeclarationNode<LerpColorFilterProps>;
ShaderNode: (props: ShaderProps) => DeclarationNode<ShaderProps>;
ImageShaderNode: (props: ImageShaderProps) => DeclarationNode<ImageShaderProps>;
ColorShaderNode: (props: ColorProps) => DeclarationNode<ColorProps>;
TurbulenceNode: (props: TurbulenceProps) => DeclarationNode<TurbulenceProps>;
FractalNoiseNode: (props: FractalNoiseProps) => DeclarationNode<FractalNoiseProps>;
LinearGradientNode: (props: LinearGradientProps) => DeclarationNode<LinearGradientProps>;
RadialGradientNode: (props: RadialGradientProps) => DeclarationNode<RadialGradientProps>;
SweepGradientNode: (props: SweepGradientProps) => DeclarationNode<SweepGradientProps>;
TwoPointConicalGradientNode: (props: TwoPointConicalGradientProps) => DeclarationNode<TwoPointConicalGradientProps>;
PictureNode: (props: PictureProps) => RenderNode<PictureProps>;
ImageSVGNode: (props: ImageSVGProps) => RenderNode<ImageSVGProps>;
VerticesNode: (props: VerticesProps) => RenderNode<VerticesProps>;
TextNode: (prop: TextProps) => RenderNode<TextProps>;
TextPathNode: (prop: TextPathProps) => RenderNode<TextPathProps>;
TextBlobNode: (prop: TextBlobProps) => RenderNode<TextBlobProps>;
GlyphsNode: (prop: GlyphsProps) => RenderNode<GlyphsProps>;
BlendNode: (prop: BlendProps) => DeclarationNode<BlendProps>;
BackdropFilterNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;
BoxNode: (prop: BoxProps) => RenderNode<BoxProps>;
BoxShadowNode: (prop: BoxShadowProps) => DeclarationNode<BoxShadowProps>;
LayerNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;
ParagraphNode: (props: ParagraphProps) => RenderNode<ParagraphProps>;
};
namespace JSX {
interface IntrinsicElements {
skGroup: SkiaProps<GroupProps>;
skLayer: SkiaProps<ChildrenProps>;
skPaint: SkiaProps<PaintProps>;
skFill: SkiaProps<DrawingNodeProps>;
skImage: SkiaProps<ImageProps>;
skCircle: SkiaProps<CircleProps>;
skPath: SkiaProps<PathProps>;
skDrawing: SkiaProps<CustomDrawingNodeProps>;
skLine: SkiaProps<LineProps>;
skOval: SkiaProps<OvalProps>;
skPatch: SkiaProps<PatchProps>;
skPoints: SkiaProps<PointsProps>;
skRect: SkiaProps<RectProps>;
skRRect: SkiaProps<RoundedRectProps>;
skVertices: SkiaProps<VerticesProps>;
skText: SkiaProps<TextProps>;
skTextPath: SkiaProps<TextPathProps>;
skTextBlob: SkiaProps<TextBlobProps>;
skGlyphs: SkiaProps<GlyphsProps>;
skDiffRect: SkiaProps<DiffRectProps>;
skPicture: SkiaProps<PictureProps>;
skImageSVG: SkiaProps<ImageSVGProps>;
skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;
skBlendImageFilter: SkiaProps<BlendImageFilterProps>;
skBlurImageFilter: SkiaProps<BlurImageFilterProps>;
skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;
skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;
skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;
skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;
skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;
skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;
skBlendColorFilter: SkiaProps<BlendColorFilterProps>;
skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;
skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;
skLumaColorFilter: SkiaProps<ChildrenProps>;
skLerpColorFilter: SkiaProps<LerpColorFilterProps>;
skShader: SkiaProps<ShaderProps>;
skImageShader: SkiaProps<ImageShaderProps>;
skColorShader: SkiaProps<ColorProps>;
skTurbulence: SkiaProps<TurbulenceProps>;
skFractalNoise: SkiaProps<FractalNoiseProps>;
skLinearGradient: SkiaProps<LinearGradientProps>;
skRadialGradient: SkiaProps<RadialGradientProps>;
skSweepGradient: SkiaProps<SweepGradientProps>;
skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;
skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;
skDashPathEffect: SkiaProps<DashPathEffectProps>;
skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;
skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;
skCornerPathEffect: SkiaProps<CornerPathEffectProps>;
skSumPathEffect: ChildrenProps;
skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;
skBlend: SkiaProps<BlendProps>;
skBackdropFilter: SkiaProps<ChildrenProps>;
skBox: SkiaProps<BoxProps>;
skBoxShadow: SkiaProps<BoxShadowProps>;
skParagraph: SkiaProps<ParagraphProps>;
}
}
}
export declare const createNode: (container: Container, type: NodeType, props: any) => RenderNode<ChildrenProps> | DeclarationNode<PaintProps> | DeclarationNode<BlurMaskFilterProps> | DeclarationNode<BlendImageFilterProps> | DeclarationNode<BlurImageFilterProps> | DeclarationNode<OffsetImageFilterProps> | DeclarationNode<MorphologyImageFilterProps> | DeclarationNode<DisplacementMapImageFilterProps> | DeclarationNode<RuntimeShaderImageFilterProps> | DeclarationNode<MatrixColorFilterProps> | DeclarationNode<null> | DeclarationNode<LerpColorFilterProps> | DeclarationNode<ImageShaderProps> | DeclarationNode<ColorProps> | DeclarationNode<TurbulenceProps> | DeclarationNode<LinearGradientProps> | DeclarationNode<RadialGradientProps> | DeclarationNode<SweepGradientProps> | DeclarationNode<CornerPathEffectProps> | DeclarationNode<DiscretePathEffectProps> | DeclarationNode<DashPathEffectProps> | DeclarationNode<Path1DPathEffectProps> | DeclarationNode<Path2DPathEffectProps> | DeclarationNode<Line2DPathEffectProps> | DeclarationNode<BlendProps> | DeclarationNode<BoxShadowProps>;