Devops/reviewdog typescript (#25)

* Use reviewdog for TSC

* Replace all `type Readonly<T>` with `interface T`

* Use --frozen-lockfile for yarn

* Give all actions a name

* Fix yarn example
This commit is contained in:
Marc Rousavy
2021-03-08 17:51:47 +01:00
committed by GitHub
parent 4e5a79fbde
commit f051481010
9 changed files with 131 additions and 104 deletions

View File

@@ -74,15 +74,15 @@ export type AutoFocusSystem = 'contrast-detection' | 'phase-detection' | 'none';
*/
export type VideoStabilizationMode = 'off' | 'standard' | 'cinematic' | 'cinematic-extended' | 'auto';
export type FrameRateRange = Readonly<{
export interface FrameRateRange {
minFrameRate: number;
maxFrameRate: number;
}>;
}
/**
* A Camera Device's video format. Do not create instances of this type yourself, only use `Camera.getAvailableCameraDevices(...)`.
*/
export type CameraDeviceFormat = Readonly<{
export interface CameraDeviceFormat {
/**
* The height of the highest resolution a still image (photo) can be produced in
*/
@@ -151,12 +151,12 @@ export type CameraDeviceFormat = Readonly<{
* All supported video stabilization modes
*/
videoStabilizationModes: VideoStabilizationMode[];
}>;
}
/**
* Represents a camera device discovered by the `Camera.getAvailableCameraDevices()` function
*/
export type CameraDevice = Readonly<{
export interface CameraDevice {
/**
* The native ID of the camera device instance.
*/
@@ -230,4 +230,4 @@ export type CameraDevice = Readonly<{
// * Whether this camera supports taking photos in RAW format
// */
// supportsRawCapture: boolean;
}>;
}

View File

@@ -24,7 +24,7 @@ export type CodeType =
/**
* Represents a Metadata Code read by the Camera. Example: QR Code
*/
export type Code = Readonly<{
export interface Code {
/**
* The decoded string representation of the code.
*/
@@ -62,4 +62,4 @@ export type Code = Readonly<{
*/
height: number;
};
}>;
}

View File

@@ -65,74 +65,72 @@ export interface TakePhotoOptions {
/**
* Represents a Photo taken by the Camera written to the local filesystem.
*/
export type PhotoFile = Readonly<
TemporaryFile & {
width: number;
height: number;
isRawPhoto: boolean;
thumbnail?: Record<string, unknown>;
metadata: {
Orientation: number;
export interface PhotoFile extends TemporaryFile {
width: number;
height: number;
isRawPhoto: boolean;
thumbnail?: Record<string, unknown>;
metadata: {
Orientation: number;
/**
* @platform iOS
*/
DPIHeight: number;
/**
* @platform iOS
*/
DPIWidth: number;
/**
* Represents any data Apple cameras write to the metadata
*
* @platform iOS
*/
'{MakerApple}'?: Record<string, unknown>;
'{TIFF}': {
ResolutionUnit: number;
Software: string;
Make: string;
DateTime: string;
XResolution: number;
/**
* @platform iOS
*/
DPIHeight: number;
/**
* @platform iOS
*/
DPIWidth: number;
/**
* Represents any data Apple cameras write to the metadata
*
* @platform iOS
*/
'{MakerApple}'?: Record<string, unknown>;
'{TIFF}': {
ResolutionUnit: number;
Software: string;
Make: string;
DateTime: string;
XResolution: number;
/**
* @platform iOS
*/
HostComputer?: string;
Model: string;
YResolution: number;
};
'{Exif}': {
DateTimeOriginal: string;
ExposureTime: number;
FNumber: number;
LensSpecification: number[];
ExposureBiasValue: number;
ColorSpace: number;
FocalLenIn35mmFilm: number;
BrightnessValue: number;
ExposureMode: number;
LensModel: string;
SceneType: number;
PixelXDimension: number;
ShutterSpeedValue: number;
SensingMethod: number;
SubjectArea: number[];
ApertureValue: number;
SubsecTimeDigitized: string;
FocalLength: number;
LensMake: string;
SubsecTimeOriginal: string;
OffsetTimeDigitized: string;
PixelYDimension: number;
ISOSpeedRatings: number[];
WhiteBalance: number;
DateTimeDigitized: string;
OffsetTimeOriginal: string;
ExifVersion: string;
OffsetTime: string;
Flash: number;
ExposureProgram: number;
MeteringMode: number;
};
HostComputer?: string;
Model: string;
YResolution: number;
};
}
>;
'{Exif}': {
DateTimeOriginal: string;
ExposureTime: number;
FNumber: number;
LensSpecification: number[];
ExposureBiasValue: number;
ColorSpace: number;
FocalLenIn35mmFilm: number;
BrightnessValue: number;
ExposureMode: number;
LensModel: string;
SceneType: number;
PixelXDimension: number;
ShutterSpeedValue: number;
SensingMethod: number;
SubjectArea: number[];
ApertureValue: number;
SubsecTimeDigitized: string;
FocalLength: number;
LensMake: string;
SubsecTimeOriginal: string;
OffsetTimeDigitized: string;
PixelYDimension: number;
ISOSpeedRatings: number[];
WhiteBalance: number;
DateTimeDigitized: string;
OffsetTimeOriginal: string;
ExifVersion: string;
OffsetTime: string;
Flash: number;
ExposureProgram: number;
MeteringMode: number;
};
};
}

View File

@@ -1,9 +1,9 @@
/**
* Represents a temporary file in the local filesystem.
*/
export type TemporaryFile = Readonly<{
export interface TemporaryFile {
/**
* The path of the file. This file might get deleted once the app closes because it lives in the temp directory.
*/
path: string;
}>;
}

View File

@@ -47,15 +47,13 @@ export interface RecordVideoOptions {
/**
* Represents a Video taken by the Camera written to the local filesystem.
*/
export type VideoFile = Readonly<
TemporaryFile & {
/**
* Represents the duration of the video, in seconds.
*/
duration: number;
/**
* Represents the file size of the recorded Video File, in bytes.
*/
size: number;
}
>;
export interface VideoFile extends TemporaryFile {
/**
* Represents the duration of the video, in seconds.
*/
duration: number;
/**
* Represents the file size of the recorded Video File, in bytes.
*/
size: number;
}