Skip to content

Commit d5b1687

Browse files
committed
docs: add doc comments to async spec methods
1 parent bd05f51 commit d5b1687

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/specs/RiveFile.nitro.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,20 @@ export interface RiveFile
3737
/** @deprecated Use getArtboardNamesAsync instead */
3838
readonly artboardNames: string[];
3939

40+
/** The names of all view models in the Rive file */
4041
getViewModelNamesAsync(): Promise<string[]>;
42+
/** Get a view model by name, optionally validating its properties */
4143
viewModelByNameAsync(
4244
name: string,
4345
validate?: boolean
4446
): Promise<ViewModel | undefined>;
47+
/** Get the default view model for the given artboard */
4548
defaultArtboardViewModelAsync(
4649
artboardBy?: ArtboardBy
4750
): Promise<ViewModel | undefined>;
51+
/** The number of artboards in the Rive file */
4852
getArtboardCountAsync(): Promise<number>;
53+
/** The names of all artboards in the Rive file */
4954
getArtboardNamesAsync(): Promise<string[]>;
5055
/**
5156
* Get a bindable artboard by name for use with data binding.

src/specs/ViewModel.nitro.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ export interface ViewModel
2323
/** @deprecated Use createBlankInstanceAsync instead */
2424
createInstance(): ViewModelInstance | undefined;
2525

26+
/** Create a view model instance by name */
2627
createInstanceByNameAsync(
2728
name: string
2829
): Promise<ViewModelInstance | undefined>;
30+
/** Create the default view model instance */
2931
createDefaultInstanceAsync(): Promise<ViewModelInstance | undefined>;
32+
/** Create a blank view model instance with default property values */
3033
createBlankInstanceAsync(): Promise<ViewModelInstance | undefined>;
3134
}
3235

@@ -73,6 +76,7 @@ export interface ViewModelInstance
7376
*/
7477
viewModel(path: string): ViewModelInstance | undefined;
7578

79+
/** Get a nested ViewModel instance at the given path. Supports "/" for nested access (e.g., "Parent/Child"). */
7680
viewModelAsync(path: string): Promise<ViewModelInstance | undefined>;
7781

7882
/**
@@ -96,6 +100,7 @@ export interface ViewModelNumberProperty
96100
ObservableProperty {
97101
/** @deprecated Use getValueAsync (read) or set(value) (write) instead */
98102
value: number;
103+
/** Get the current value of the number property */
99104
getValueAsync(): Promise<number>;
100105
set(value: number): void;
101106
/** Add a listener to the view model number property. Returns a function to remove the listener. */
@@ -107,6 +112,7 @@ export interface ViewModelStringProperty
107112
ObservableProperty {
108113
/** @deprecated Use getValueAsync (read) or set(value) (write) instead */
109114
value: string;
115+
/** Get the current value of the string property */
110116
getValueAsync(): Promise<string>;
111117
set(value: string): void;
112118
/** Add a listener to the view model string property. Returns a function to remove the listener. */
@@ -118,6 +124,7 @@ export interface ViewModelBooleanProperty
118124
ObservableProperty {
119125
/** @deprecated Use getValueAsync (read) or set(value) (write) instead */
120126
value: boolean;
127+
/** Get the current value of the boolean property */
121128
getValueAsync(): Promise<boolean>;
122129
set(value: boolean): void;
123130
/** Add a listener to the view model boolean property. Returns a function to remove the listener. */
@@ -129,6 +136,7 @@ export interface ViewModelColorProperty
129136
ObservableProperty {
130137
/** @deprecated Use getValueAsync (read) or set(value) (write) instead */
131138
value: number;
139+
/** Get the current value of the color property */
132140
getValueAsync(): Promise<number>;
133141
set(value: number): void;
134142
/** Add a listener to the view model color property. Returns a function to remove the listener. */
@@ -140,6 +148,7 @@ export interface ViewModelEnumProperty
140148
ObservableProperty {
141149
/** @deprecated Use getValueAsync (read) or set(value) (write) instead */
142150
value: string;
151+
/** Get the current value of the enum property */
143152
getValueAsync(): Promise<string>;
144153
set(value: string): void;
145154
/** Add a listener to the view model enum property. Returns a function to remove the listener. */
@@ -175,7 +184,9 @@ export interface ViewModelListProperty
175184
readonly length: number;
176185
/** @deprecated Use getInstanceAtAsync instead */
177186
getInstanceAt(index: number): ViewModelInstance | undefined;
187+
/** The number of instances in the list */
178188
getLengthAsync(): Promise<number>;
189+
/** Get the instance at the given index */
179190
getInstanceAtAsync(index: number): Promise<ViewModelInstance | undefined>;
180191
/** Add an instance to the end of the list */
181192
addInstance(instance: ViewModelInstance): void;

0 commit comments

Comments
 (0)