-
Notifications
You must be signed in to change notification settings - Fork 14
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
TS SDK #673
TS SDK #673
Conversation
7f5a6c0
to
0d570a5
Compare
0d570a5
to
07c4de5
Compare
TilesProps, | ||
}; | ||
|
||
export { ShaderParam, ShaderParamStructField, EasingFunction, Transition }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about that, the problem here is that types are partially defined in API and partially overridden here. Technically those types will not be imported in user code, but it still more messy than what I would prefer
|
||
## Documentation | ||
|
||
Components props are documented via TypeScript types definitions in this package. You can also refer to LiveCompositor (e.g. [View](https://compositor.live/docs/api/components/View)), but keep in mind to convert field names from snake case to camel case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to add separate docs for typescript, but I did not think it through yet how it will work
/** | ||
* (**default=`"#00000000"`**) Background color in a `"#RRGGBBAA"` format. | ||
*/ | ||
backgroundColorRgba?: Api.RGBAColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm considering renaming that to backgroundColor
and supporting more formats than the LiveCompositor server does.
/** | ||
* Path to the MP4 file. | ||
*/ | ||
path?: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe serverPath to avoid confusion if the node is deployed in a different location than the compositor.
export function intoRegisterOutput( | ||
output: RegisterOutput, | ||
initialVideo?: Api.Video | ||
): Api.RegisterOutput { | ||
if (output.type === 'rtp_stream') { | ||
return intoRegisterRtpOutput(output, initialVideo); | ||
} else { | ||
throw new Error(`Unknown input type ${(output as any).type}`); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add mp4 output
/** | ||
* Id of a component. | ||
*/ | ||
id?: Api.ComponentId | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is | null
necessary if the field is marked with ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? means no value or undefined, null is not allowed there if it's just ?
, but on the other hand in other places I was removing that | null
(generation from json schema is producing that)
Packages
live-compositor
- main package user interacts, minimal dependencies, this package would be the only that third party libs should depend@live-compositor/node
- Implements node specific stuff, used to create instance of the compositor, there will bereact
andreact-native
variants in the future@live-compositor/core
- Implements platform independent part that will be used by packages like@live-compositor/node
or react/react-nativeexamples
simple
- basic View + Text example with some state updates.dynamic-text
- Component that shows text adding letter by letter (and removing it back in the loop)news-ticker
- Component that implements moving bar of text that loops on itself (video below)recording_0819_1432.mp4