Skip to content

[PPRO] Added missing args and types to ComponentParam and TrackItem #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
38 changes: 26 additions & 12 deletions Premiere/15.0/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ declare class TrackItem {
/**
*
*/
readonly components: any
readonly components: Component[]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly components: Component[]
readonly components: ComponentCollection


/**
*
Expand Down Expand Up @@ -2010,26 +2010,40 @@ declare class ComponentParamCollection {

declare class ComponentParam {
readonly displayName: string
addKey(): boolean
addKey(time: Time, updateUI?: boolean): boolean
areKeyframesSupported(): boolean
findNearestKey(): object
findNextKey(): object
findPreviousKey(): object
/**
* threshold in ticks
*/
findNearestKey(timeToCheck: Time, threshold: number): object
Comment on lines +2015 to +2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the comment, and ticks usually come as string if I'm not mistaken

Suggested change
/**
* threshold in ticks
*/
findNearestKey(timeToCheck: Time, threshold: number): object
findNearestKey(timeToCheck: Time, thresholdInTicks: string): object

findNextKey(timeToCheck: Time): object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time to check doesn't add much context / explanation. Better to leave it as time

Suggested change
findNextKey(timeToCheck: Time): object
findNextKey(time: Time): object

findPreviousKey(timeToCheck: Time): object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
findPreviousKey(timeToCheck: Time): object
findPreviousKey(time: Time): object

getColorValue(): any[]
getKeys(): any[]
getValue(): any
getValueAtKey(): any
getValueAtTime(): any
getValueAtKey(timeToCheck: Time): any

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
getValueAtKey(timeToCheck: Time): any
getValueAtKey(time: Time): any

getValueAtTime(time: Time): any
isEmpty(): boolean
isTimeVarying(): boolean
keyExistsAtTime(): boolean
removeKey(): boolean
removeKey(time: Time, updateUI?: boolean): boolean
removeKeyRange(start: Time, end: Time): boolean
setColorValue(p0: number, p1: number, p2: number, p3: number, p4: boolean): boolean
setInterpolationTypeAtKey(): boolean
setTimeVarying(p0: boolean, p1: boolean): boolean
setColorValue(alpha: number, red: number, green: number, blue: number, updateUI: boolean): boolean
/**
* interpolationType must be one of the following:
* 0 KF_Interp_Mode_Linear
* 1 kfInterpMode_EaseIn_Obsolete
* 2 kfInterpMode_EaseOut_Obsolete
* 3 kfInterpMode_EaseInEaseOut_Obsolete
* 4 KF_Interp_Mode_Hold
* 5 KF_Interp_Mode_Bezier
* 6 KF_Interp_Mode_Time
* 7 kfInterpMode_TimeTransitionStart
* 8 kfInterpMode_TimeTransitionEnd
* */
setInterpolationTypeAtKey(time: Time, interpolationType: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, updateUI?: boolean): boolean
Comment on lines +2031 to +2044

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead create an enum conforming to the TIME_FORMAT:

declare enum INTERPOLATION_TYPE {
  KFINTERPMODE_Linear,
  KFINTERPMODE_EaseIn_Obsolete,
  KFINTERPMODE_EaseOut_Obsolete,
  KFINTERPMODE_EaseInEaseOut_Obsolete,
  KFINTERPMODE_Hold,
  KFINTERPMODE_Bezier,
  KFINTERPMODE_Time,
  KFINTERPMODE_TimeTransitionStart,
  KFINTERPMODE_TimeTransitionEnd,
}

And then use it in the parameter type:

setInterpolationTypeAtKey(time: Time, interpolationType: INTERPOLATION_TYPE, updateUI?: boolean): boolean

setValue(value: any, updateUI?: boolean): boolean
setValueAtKey(): boolean
setValueAtKey(time: Time, value: any, updateUI: boolean): boolean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setValueAtKey(time: Time, value: any, updateUI: boolean): boolean
setValueAtKey(time: Time, value: any, updateUI?: boolean): boolean

}
/**
*
Expand Down