Skip to content

Commit 5a0dd67

Browse files
committed
continue documenting
1 parent 6663308 commit 5a0dd67

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

src/index.ts

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -365,37 +365,53 @@ class Property<PropertyValueType extends Value> {
365365
}
366366

367367
export class PathProperty<T> extends Property<T> {
368-
readonly isClosed: boolean = true;
368+
/**
369+
* Creates a path object from a set of points and tangents.
370+
* @param points An array of number pair arrays representing x,y coordinates of the path points. The array length must be at least 1, and can be of any greater length.
371+
* @param inTangents An array containing number pair arrays representing the `[x,y]` offset coordinates of the tangent handles to the path points. Required unless no parameters are passed (i.e., `createPath()`). The array length must be the same as points, or you can pass an empty array (`[]`), which will assume the same length as points and `[0,0]` for all tangents.
372+
* @param outTangents See `inTangents`
373+
* @param isClosed Determines if the mask is closed. If true, the last point will be connected to the first point.
374+
*/
369375
createPath(
370-
points: Points,
371-
inTangents: Points | [],
372-
outTangent: Points | [],
373-
isClosed: boolean
374-
): PathValue {
375-
return [
376-
[0, 0],
377-
[0, 0],
378-
[0, 0],
376+
points: Points = [
379377
[0, 0],
380-
];
378+
[100, 0],
379+
[100, 100],
380+
[0, 100],
381+
],
382+
inTangents: Points | [] = [],
383+
outTangents: Points | [] = [],
384+
is_closed: boolean = true
385+
): PathValue {
386+
return points;
381387
}
382-
points(time?: number): Vector2D[] {
388+
/**
389+
* @returns Whether a path is closed (the last point connected to the first)
390+
*/
391+
isClosed(): boolean {
392+
return true;
393+
}
394+
/**
395+
* Retrieves the points array for a path
396+
* @param time The time at which to sample the path
397+
*/
398+
points(time: number = thisLayer.time): Points {
383399
return [
384400
[0, 0],
385401
[0, 0],
386402
[0, 0],
387403
[0, 0],
388404
];
389405
}
390-
inTangents(time?: number): Vector2D[] {
406+
inTangents(time?: number): Points {
391407
return [
392408
[0, 0],
393409
[0, 0],
394410
[0, 0],
395411
[0, 0],
396412
];
397413
}
398-
outTangents(time?: number): Vector2D[] {
414+
outTangents(time?: number): Points {
399415
return [
400416
[0, 0],
401417
[0, 0],

0 commit comments

Comments
 (0)