1- import { Path } from "typescript" ;
1+ /// <reference path="./index.d.ts" />
22
33// Global objects, attributes, and methods
44export const PathBase : PathValue = { } ;
55export const KeyBase : Key = {
66 value : "key value" ,
77 time : 0 ,
88} ;
9- export const PropertyGroupBase = { } ;
9+ export const PointsBase : Vector2D [ ] = [
10+ [ 0 , 0 ] ,
11+ [ 100 , 0 ] ,
12+ [ 100 , 100 ] ,
13+ [ 0 , 100 ] ,
14+ ] ;
15+
16+ export const CompBase : Comp = {
17+ name : "Comp Base" ,
18+ numLayers : 1 ,
19+ activeCamera : null ,
20+ width : 1920 ,
21+ height : 1080 ,
22+ duration : 10 ,
23+ ntscDropFrame : false ,
24+ displayStartTime : 0 ,
25+ frameDuration : 0.04 ,
26+ frameRate : 25 ,
27+ shutterAngle : 180 ,
28+ bgColor : [ 1 , 1 , 1 , 1 ] ,
29+ pixelAspect : 1 ,
30+ layer : ( indexOrOtherLayer , relIndex ) => LayerBase ,
31+ } ;
32+
33+ export const PropertyGroupBase : PropertyGroup = {
34+ name : "property group base" ,
35+ } ;
36+ export const ValueBase = 1 ;
1037export const PropertyBase : PathProperty = {
1138 value : "property base string value" ,
1239 name : "property name" ,
1340 velocity : 0 ,
1441 speed : 0 ,
1542 numKeys : 0 ,
1643 propertyIndex : 1 ,
17- valueAtTime : ( time ) => this . value ,
18- velocityAtTime : ( time ) => this . velocity ,
19- speedAtTime : ( time ) => this . speed ,
20- wiggle : ( freq , amp , octaves = 1 , amp_mult = 0.5 , t = time ) => this . value ,
44+ valueAtTime : ( time ) => ValueBase ,
45+ velocityAtTime : ( time ) => 0 ,
46+ speedAtTime : ( time ) => 0 ,
47+ wiggle : ( freq , amp , octaves = 1 , amp_mult = 0.5 , t = time ) => ValueBase ,
2148 temporalWiggle : ( freq , amp , octaves = 1 , amp_mult = 0.5 , t = time ) =>
22- this . value ,
23- smooth : ( width = 0.2 , samples = 5 , t = time ) => this . value ,
24- loopIn : ( type = "cycle" , numKeyframes = 0 ) => this . value ,
25- loopOut : ( type = "cycle" , numKeyframes = 0 ) => this . value ,
26- loopInDuration : ( type = "cycle" , duration = 0 ) => this . value ,
27- loopOutDuration : ( type = "cycle" , duration = 0 ) => this . value ,
49+ ValueBase ,
50+ smooth : ( width = 0.2 , samples = 5 , t = time ) => ValueBase ,
51+ loopIn : ( type = "cycle" , numKeyframes = 0 ) => ValueBase ,
52+ loopOut : ( type = "cycle" , numKeyframes = 0 ) => ValueBase ,
53+ loopInDuration : ( type = "cycle" , duration = 0 ) => ValueBase ,
54+ loopOutDuration : ( type = "cycle" , duration = 0 ) => ValueBase ,
2855 createPath : ( points , inTangents = [ ] , outTangent = [ ] , isClosed = true ) =>
2956 PathBase ,
3057 key : ( indexOrName ) => KeyBase ,
3158 propertyGroup : ( countUp = 1 ) => PropertyGroupBase ,
59+ points : ( t = time ) => PointsBase ,
60+ inTangents : ( t = time ) => PointsBase ,
61+ outTangents : ( t = time ) => PointsBase ,
62+ isClosed : ( ) => true ,
63+ pointOnPath : ( percentage = 0.5 , t = time ) => [ 0 , 0 ] ,
64+ tangentOnPath : ( percentage = 0.5 , t = time ) => [ 0 , 0 ] ,
65+ normalOnPath : ( percentage = 0.5 , t = time ) => [ 0 , 0 ] ,
66+ } ;
67+
68+ const TransformBase : Transform = {
69+ name : "Transform" ,
70+ anchorPoint : PropertyBase ,
71+ position : PropertyBase ,
72+ scale : PropertyBase ,
73+ rotation : PropertyBase ,
74+ orientation : PropertyBase ,
75+ rotationX : PropertyBase ,
76+ } ;
77+
78+ const MaterialBase : MaterialOptions = {
79+ name : "Material Property Group" ,
80+ lightTransmission : PropertyBase ,
81+ castShadows : PropertyBase ,
82+ acceptsShadows : PropertyBase ,
83+ acceptsLights : PropertyBase ,
84+ ambient : PropertyBase ,
85+ diffuse : PropertyBase ,
86+ specular : PropertyBase ,
87+ shininess : PropertyBase ,
88+ metal : PropertyBase ,
89+ } ;
90+
91+ export const SourceRectBase : SourceRect = {
92+ top : 0 ,
93+ left : 0 ,
94+ width : 100 ,
95+ height : 100 ,
96+ } ;
97+
98+ export const EffectBase : Effect = {
99+ active : true ,
100+ param : ( nameOrIndex ) => PropertyBase ,
101+ } ;
102+
103+ export const MaskBase : Mask = {
104+ maskOpacity : PropertyBase ,
105+ maskExpansion : PropertyBase ,
106+ maskFeather : PropertyBase ,
107+ invert : false ,
108+ } ;
109+
110+ export const LayerBase : Layer = {
111+ name : "layer base" ,
112+ source : CompBase ,
113+ width : 1920 ,
114+ height : 1080 ,
115+ index : 0 ,
116+ hasParent : false ,
117+ inPoint : 0 ,
118+ outPoint : 1 ,
119+ startTime : 0 ,
120+ hasVideo : false ,
121+ hasAudio : false ,
122+ active : true ,
123+ enabled : true ,
124+ transform : TransformBase ,
125+ materialOption : MaterialBase ,
126+ toComp : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
127+ fromComp : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
128+ toWorld : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
129+ toCompVec : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
130+ fromCompVec : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
131+ toWorldVec : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
132+ fromWorldVec : ( vec , t = time ) => [ 0 , 0 , 0 ] ,
133+ fromCompToSurface : ( vec ) => [ 0 , 0 , 0 ] ,
134+ sourceTime : ( t = time ) => 0 ,
135+ sourceRectAtTime : ( t = time , includeExtents = false ) => SourceRectBase ,
136+ effect : ( nameOrIndex ) => EffectBase ,
137+ mask : ( nameOrIndex ) => MaskBase ,
138+ sampleImage : (
139+ point ,
140+ radius = [ 0.5 , 0.5 ] ,
141+ postEffect ?: boolean ,
142+ time ?: number
143+ ) => [ 1 , 1 , 1 , 1 ] ,
32144} ;
33145
34146export const layer = CompBase . layer ;
@@ -39,7 +151,22 @@ export function comp(index: number | string) {
39151export const time : number = 0 ;
40152export const colorDepth : number = 8 ;
41153
42- export function footage ( name : string ) : Footage { }
154+ const FootageBase : Footage = {
155+ name : "Footage Item" ,
156+ width : 1920 ,
157+ height : 1080 ,
158+ duration : 10 ,
159+ frameDuration : 0.04 ,
160+ ntscDropFrame : false ,
161+ pixelAspect : 1 ,
162+ sourceText : "Source text" ,
163+ sourceData : [ "Source data" ] as SourceData ,
164+ dataValue : ( dataPath : [ ] ) => "data value" ,
165+ } ;
166+
167+ export function footage ( name : string ) : Footage {
168+ return FootageBase ;
169+ }
43170
44171// Time conversion methods
45172
0 commit comments