Add more TypeDoc links
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user