Skip to content

Commit 042edfe

Browse files
committed
move to classes based setup
1 parent 070c626 commit 042edfe

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,26 @@ This library mocks the After Effects expressions API in TypeScript, providing ty
2525
} from "expression-globals-typescript";
2626
```
2727

28-
3. Import object bases to create layer, comp, and property mocks
28+
3. Import classes to create layer, comp, and property mocks
2929

30-
```js
31-
import {
32-
PropertyBase,
33-
LayerBase,
34-
CompBase,
35-
} from "expression-globals-typescript";
30+
```ts
31+
import { Property, Layer, Comp } from "expression-globals-typescript";
3632

37-
const thisProperty = Object.create(PropertyBase);
38-
const thisLayer = Object.create(LayerBase);
39-
const thisComp = Object.create(CompBase);
33+
const thisProperty = new Property<string>("Property value");
34+
const thisLayer = new Layer();
35+
const thisComp = new Comp();
4036
```
4137

4238
You can then use the properties and methods of these objects as you would within expressions.
4339

40+
The `Property` constructor function takes a value and type (`<>`) for the `value` of the `Property`.
41+
4442
4. Import types
4543

46-
This package makes available After Effects specific types, such as `Layer`, `Comp`, `Color`, `Vector` and more. See `src/index.ts` for the available types.
44+
This package makes available After Effects specific types, such as `Color`, `Vector` and more. See `src/index.ts` for the available types.
4745

4846
```js
49-
import { Comp, Layer, Color } from "expression-globals-typescript";
47+
import { Color, Vector, Value } from "expression-globals-typescript";
5048
```
5149

5250
## Why?

0 commit comments

Comments
 (0)