Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,203 changes: 1,224 additions & 979 deletions index.d.ts

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.js.map

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
"author": "Aidos Sabit <https://github.com/aidosmf/>",
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.24.3",
"@types/node": "^17.0.23",
"husky": "^7.0.4",
"lint-staged": "^12.3.7",
"prettier": "2.6.2",
"rollup": "^2.66.1",
"rollup-plugin-dts": "^4.1.0",
"typescript": "^4.6.3"
"@changesets/cli": "^2.28.1",
"@rollup/plugin-typescript": "^12.1.2",
"@types/node": "^22.13.14",
"husky": "^9.1.7",
"lint-staged": "^15.5.0",
"prettier": "^3.5.3",
"rollup": "^4.38.0",
"rollup-plugin-dts": "^6.2.1",
"typescript": "^5.8.2"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
Expand Down
17 changes: 15 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dts from "rollup-plugin-dts";
import pkg from "./package.json";
import typescript from "@rollup/plugin-typescript";
import pkg from "./package.json" with { type: "json" };

const compiledAt = new Date().toUTCString().replace(/GMT/g, "UTC");

Expand All @@ -26,7 +27,19 @@ const banner = [

const config = [
{
input: "./src/index.d.ts",
input: "./src/index.ts",
output: [
{
banner,
file: "./index.js",
format: "es",
sourcemap: true,
},
],
plugins: [typescript({ tsconfig: "./tsconfig.json" })],
},
{
input: "./src/index.ts",
output: [{ banner, file: "./index.d.ts", format: "es" }],
plugins: [dts()],
},
Expand Down
1 change: 1 addition & 0 deletions src/animated-property.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Helpers } from "./helpers";

export declare type AnimatedProperty = AnimatedProperty.Value;
export declare namespace AnimatedProperty {
/**
* Bezier handle for keyframe interpolation
Expand Down
1 change: 1 addition & 0 deletions src/asset.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Composition } from "./animation";
import { Helpers } from "./helpers";

export declare type Asset = Asset.Value;
export declare namespace Asset {
interface Main extends Helpers.Name {
/**
Expand Down
124 changes: 64 additions & 60 deletions src/constants/blend-mode.d.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
export declare namespace BlendMode {
/**
* Layer and shape blend mode
*/
type Value =
| Normal
| Multiply
| Screen
| Overlay
| Darken
| Lighten
| ColorDodge
| ColorBurn
| HardLight
| SoftLight
| Difference
| Exclusion
| Hue
| Saturation
| Color
| Luminosity
| Add
| HardMix;
import { Helpers } from "../helpers";

type Normal = 0;
type Multiply = 1;
type Screen = 2;
type Overlay = 3;
type Darken = 4;
type Lighten = 5;
type ColorDodge = 6;
type ColorBurn = 7;
type HardLight = 8;
type SoftLight = 9;
type Difference = 10;
type Exclusion = 11;
type Hue = 12;
type Saturation = 13;
type Color = 14;
type Luminosity = 15;
type Add = 16;
type HardMix = 17;
/**
* Layer and shape blend mode
*/
export type BlendMode = Helpers.Values<typeof BlendMode>;
export namespace BlendMode {
export type Value = BlendMode;

const enum VALUE {
NORMAL = 0,
MULTIPLY = 1,
SCREEN = 2,
OVERLAY = 3,
DARKEN = 4,
LIGHTEN = 5,
COLOR_DODGE = 6,
COLOR_BURN = 7,
HARD_LIGHT = 8,
SOFT_LIGHT = 9,
DIFFERENCE = 10,
EXCLUSION = 11,
HUE = 12,
SATURATION = 13,
COLOR = 14,
LUMINOSITY = 15,
ADD = 16,
HARD_MIX = 17,
export const Normal = 0;
export type Normal = typeof Normal;
export const Multiply = 1;
export type Multiply = typeof Multiply;
export const Screen = 2;
export type Screen = typeof Screen;
export const Overlay = 3;
export type Overlay = typeof Overlay;
export const Darken = 4;
export type Darken = typeof Darken;
export const Lighten = 5;
export type Lighten = typeof Lighten;
export const ColorDodge = 6;
export type ColorDodge = typeof ColorDodge;
export const ColorBurn = 7;
export type ColorBurn = typeof ColorBurn;
export const HardLight = 8;
export type HardLight = typeof HardLight;
export const SoftLight = 9;
export type SoftLight = typeof SoftLight;
export const Difference = 10;
export type Difference = typeof Difference;
export const Exclusion = 11;
export type Exclusion = typeof Exclusion;
export const Hue = 12;
export type Hue = typeof Hue;
export const Saturation = 13;
export type Saturation = typeof Saturation;
export const Color = 14;
export type Color = typeof Color;
export const Luminosity = 15;
export type Luminosity = typeof Luminosity;
export const Add = 16;
export type Add = typeof Add;
export const HardMix = 17;
export type HardMix = typeof HardMix;

/** @deprecated Use the {@linkcode BlendMode} namespace */
export const enum VALUE {
NORMAL = Normal,
MULTIPLY = Multiply,
SCREEN = Screen,
OVERLAY = Overlay,
DARKEN = Darken,
LIGHTEN = Lighten,
COLOR_DODGE = ColorDodge,
COLOR_BURN = ColorBurn,
HARD_LIGHT = HardLight,
SOFT_LIGHT = SoftLight,
DIFFERENCE = Difference,
EXCLUSION = Exclusion,
HUE = Hue,
SATURATION = Saturation,
COLOR = Color,
LUMINOSITY = Luminosity,
ADD = Add,
HARD_MIX = HardMix,
}
}
26 changes: 16 additions & 10 deletions src/constants/composite.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
export declare namespace Composite {
/**
* How to stack copies in a repeater
*/
type Value = Above | Below;
import { Helpers } from "../helpers";

type Above = 1;
type Below = 2;
/**
* How to stack copies in a repeater
*/
export type Composite = Helpers.Values<typeof Composite>;
export namespace Composite {
export type Value = Composite;

const enum VALUE {
ABOVE = 1,
BELOW = 2,
export const Above = 1;
export type Above = typeof Above;
export const Below = 2;
export type Below = typeof Below;

/** @deprecated Use the {@linkcode Composite} namespace */
export const enum VALUE {
ABOVE = Above,
BELOW = Below,
}
}
106 changes: 55 additions & 51 deletions src/constants/effect-type.d.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,59 @@
export declare namespace EffectType {
type Value =
| DropShadow
| Fill
| GaussianBlur
| Matte3
| ProLevels
| Stroke
| Tint
| Tritone
| RadialWipe
| Wavy
| Puppet
| Spherize
| PaintOverTransparent
| MeshWarp
| DisplacementMap
| Custom;
import { Helpers } from "../helpers";

type DropShadow = 25;
type Fill = 21;
type GaussianBlur = 29;
type Matte3 = 28;
type ProLevels = 24;
type Stroke = 22;
type Tint = 20;
type Tritone = 23;
type RadialWipe = 26;
type Wavy = 32;
type Puppet = 34;
type Spherize = 33;
type PaintOverTransparent = 7;
type MeshWarp = 31;
type DisplacementMap = 27;
type Custom = 5;
export type EffectType = Helpers.Values<typeof EffectType>;
export namespace EffectType {
export type Value = EffectType;

const enum VALUE {
DROP_SHADOW = 25,
FILL = 21,
GAUSSIAN_BLUR = 29,
MATTE3 = 28,
PRO_LEVELS = 24,
STROKE = 22,
TINT = 20,
TRITONE = 23,
RADIAL_WIPE = 26,
WAVY = 32,
PUPPET = 34,
SPHERIZE = 33,
PAINT_OVER_TRANSPARENT = 7,
MESH_WARP = 31,
DISPLACEMENT_MAP = 27,
CUSTOM = 5,
export const Custom = 5;
export type Custom = typeof Custom;
export const PaintOverTransparent = 7;
export type PaintOverTransparent = typeof PaintOverTransparent;
export const Tint = 20;
export type Tint = typeof Tint;
export const Fill = 21;
export type Fill = typeof Fill;
export const Stroke = 22;
export type Stroke = typeof Stroke;
export const Tritone = 23;
export type Tritone = typeof Tritone;
export const ProLevels = 24;
export type ProLevels = typeof ProLevels;
export const DropShadow = 25;
export type DropShadow = typeof DropShadow;
export const RadialWipe = 26;
export type RadialWipe = typeof RadialWipe;
export const DisplacementMap = 27;
export type DisplacementMap = typeof DisplacementMap;
export const Matte3 = 28;
export type Matte3 = typeof Matte3;
export const GaussianBlur = 29;
export type GaussianBlur = typeof GaussianBlur;
export const MeshWarp = 31;
export type MeshWarp = typeof MeshWarp;
export const Wavy = 32;
export type Wavy = typeof Wavy;
export const Spherize = 33;
export type Spherize = typeof Spherize;
export const Puppet = 34;
export type Puppet = typeof Puppet;

/** @deprecated Use the {@linkcode EffectType} namespace */
export const enum VALUE {
CUSTOM = Custom,
PAINT_OVER_TRANSPARENT = PaintOverTransparent,
TINT = Tint,
FILL = Fill,
STROKE = Stroke,
TRITONE = Tritone,
PRO_LEVELS = ProLevels,
DROP_SHADOW = DropShadow,
RADIAL_WIPE = RadialWipe,
DISPLACEMENT_MAP = DisplacementMap,
MATTE3 = Matte3,
GAUSSIAN_BLUR = GaussianBlur,
MESH_WARP = MeshWarp,
WAVY = Wavy,
SPHERIZE = Spherize,
PUPPET = Puppet,
}
}
Loading