Chore/fix lintter and ts on source prop (#3361)

* fix: Fix types for `ReactVideoSource` to also allow `require(..)` sources

We need to be careful here to not use `any`, so I used `NodeRequire` - which is afaik present in all React Native environments as a type.

---------

Co-authored-by: Marc Rousavy <me@mrousavy.com>
Co-authored-by: olivier <olivier.bouillet@ifeelsmart.com>
This commit is contained in:
Olivier Bouillet
2023-11-18 15:39:22 +01:00
committed by GitHub
parent f2e80e9f2d
commit 80e7139897
3 changed files with 12 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ import type FilterType from './FilterType';
export type Headers = Record<string, string>;
export type ReactVideoSource = Readonly<{
export type ReactVideoSourceProperties = {
uri?: string;
isNetwork?: boolean;
isAsset?: boolean;
@@ -21,7 +21,11 @@ export type ReactVideoSource = Readonly<{
subtitle?: string;
description?: string;
customImageUri?: string;
}>;
};
export type ReactVideoSource = Readonly<
ReactVideoSourceProperties | NodeRequire
>;
export type DebugConfig = Readonly<{
enable?: boolean;