Skip to content

Commit

Permalink
refactor: restric FileAssetSource types
Browse files Browse the repository at this point in the history
  • Loading branch information
HayesGordon committed Feb 4, 2025
1 parent 68bd17e commit 3538673
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,25 @@ export interface RiveRendererInterface {
): void;
}

export interface FileAssetSource {
sourceUrl?: string;
sourceAsset?: string;
sourceAssetId?: string;
path?: string;
}
export type FileAssetSource =
| {
sourceUrl: string;
sourceAsset?: never;
sourceAssetId?: never;
path?: never;
}
| {
sourceAsset: string;
sourceUrl?: never;
sourceAssetId?: never;
path?: never;
}
| {
sourceAssetId: string;
path?: string;
sourceUrl?: never;
sourceAsset?: never;
};

export interface FileHandlerOptions {
source: RiveAssetPropType | FileAssetSource;
Expand Down

0 comments on commit 3538673

Please sign in to comment.