Add more TypeDoc links

This commit is contained in:
Marc Rousavy 2021-03-08 18:21:30 +01:00
parent 8d358983f1
commit 66aae62d17
5 changed files with 18 additions and 13 deletions

View File

@ -20,7 +20,7 @@ export type PhysicalCameraDeviceType = 'ultra-wide-angle-camera' | 'wide-angle-c
export type LogicalCameraDeviceType = 'dual-camera' | 'dual-wide-camera' | 'triple-camera' | 'true-depth-camera';
/**
* Parses an array of physical device types into a single `PhysicalCameraDeviceType` or `LogicalCameraDeviceType`, depending what matches.
* Parses an array of physical device types into a single {@link PhysicalCameraDeviceType} or {@link LogicalCameraDeviceType}, depending what matches.
* @method
*/
export const parsePhysicalDeviceTypes = (physicalDeviceTypes: PhysicalCameraDeviceType[]): PhysicalCameraDeviceType | LogicalCameraDeviceType => {
@ -80,7 +80,7 @@ export interface FrameRateRange {
}
/**
* A Camera Device's video format. Do not create instances of this type yourself, only use `Camera.getAvailableCameraDevices(...)`.
* A Camera Device's video format. Do not create instances of this type yourself, only use {@link Camera.getAvailableCameraDevices}.
*/
export interface CameraDeviceFormat {
/**
@ -154,7 +154,7 @@ export interface CameraDeviceFormat {
}
/**
* Represents a camera device discovered by the `Camera.getAvailableCameraDevices()` function
* Represents a camera device discovered by the {@link Camera.getAvailableCameraDevices} function
*/
export interface CameraDevice {
/**

View File

@ -37,7 +37,7 @@ export type SystemError = 'system/no-camera-manager';
export type UnknownError = 'unknown/unknown';
/**
* Represents a JSON-style error cause. This contains native `NSError`/`Throwable` information, and can have recursive `.cause` properties until the ultimate cause has been found.
* Represents a JSON-style error cause. This contains native `NSError`/`Throwable` information, and can have recursive {@link ErrorWithCause.cause} properties until the ultimate cause has been found.
*/
export interface ErrorWithCause {
/**
@ -69,7 +69,7 @@ export interface ErrorWithCause {
*/
details?: Record<string, unknown>;
/**
* Optional stacktrace
* Optional Java stacktrace
*
* * iOS: N/A
* * Android: `Throwable.stacktrace.toString()`
@ -87,7 +87,7 @@ export interface ErrorWithCause {
type CameraErrorCode = PermissionError | ParameterError | DeviceError | FormatError | SessionError | CaptureError | SystemError | UnknownError;
/**
* Represents any kind of error that occured in the Camera View Module.
* Represents any kind of error that occured in the {@link Camera} View Module.
*/
class CameraError<TCode extends CameraErrorCode> extends Error {
private readonly _code: TCode;
@ -128,9 +128,9 @@ export class CameraRuntimeError extends CameraError<
> {}
/**
* Checks if the given `error` is of type `ErrorWithCause`
* @param error Any unknown object to validate
* @returns `true` if the given `error` is of type `ErrorWithCause`
* Checks if the given `error` is of type {@link ErrorWithCause}
* @param {unknown} error Any unknown object to validate
* @returns `true` if the given `error` is of type {@link ErrorWithCause}
*/
export const isErrorWithCause = (error: unknown): error is ErrorWithCause =>
typeof error === 'object' &&
@ -155,7 +155,7 @@ const isCameraErrorJson = (error: unknown): error is { code: string; message: st
/**
* Tries to parse an error coming from native to a typed JS camera error.
* @param {CameraError} nativeError The native error instance. This is a JSON in the legacy native module architecture.
* @returns A `CameraRuntimeError` or `CameraCaptureError`, or the nativeError if it's not parsable
* @returns A {@link CameraRuntimeError} or {@link CameraCaptureError}, or the `nativeError` itself if it's not parsable
* @method
*/
export const tryParseNativeCameraError = <T>(nativeError: T): (CameraRuntimeError | CameraCaptureError) | T => {

View File

@ -3,8 +3,9 @@ import type { TemporaryFile } from './TemporaryFile';
export interface TakePhotoOptions {
/**
* Specify the photo codec to use. To get a list of available photo codecs use the `getAvailablePhotoCodecs()` function.
* Specify the photo codec to use. To get a list of available photo codecs use the {@link Camera.getAvailablePhotoCodecs} function.
*
* @platform iOS
* @default undefined
*/
photoCodec?: CameraPhotoCodec;
@ -51,7 +52,7 @@ export interface TakePhotoOptions {
*/
enableAutoDistortionCorrection?: boolean;
/**
* When set to `true`, metadata reading and mapping will be skipped. (`PhotoFile.metadata` will be null)
* When set to `true`, metadata reading and mapping will be skipped. ({@link PhotoFile.metadata} will be null)
*
* This might result in a faster capture, as metadata reading and mapping requires File IO.
*
@ -64,6 +65,8 @@ export interface TakePhotoOptions {
/**
* Represents a Photo taken by the Camera written to the local filesystem.
*
* Related: {@link Camera.takePhoto}, {@link Camera.takeSnapshot}
*/
export interface PhotoFile extends TemporaryFile {
width: number;

View File

@ -9,7 +9,7 @@ export interface TakeSnapshotOptions {
quality?: number;
/**
* When set to `true`, metadata reading and mapping will be skipped. (`PhotoFile.metadata` will be null)
* When set to `true`, metadata reading and mapping will be skipped. ({@link PhotoFile.metadata} will be `null`)
*
* This might result in a faster capture, as metadata reading and mapping requires File IO.
*

View File

@ -46,6 +46,8 @@ export interface RecordVideoOptions {
/**
* Represents a Video taken by the Camera written to the local filesystem.
*
* Related: {@link Camera.startRecording}, {@link Camera.stopRecording}
*/
export interface VideoFile extends TemporaryFile {
/**