Automatically build API documentation (#11)

* Automatically build API documentation using Typedoc and Docusaurus
* Move MD and move to MDX for Docusaurus Guides
This commit is contained in:
Marc Rousavy
2021-03-03 12:37:43 +01:00
committed by GitHub
parent d7409e31df
commit 0b7b4d50b5
84 changed files with 15605 additions and 164 deletions

View File

@@ -36,6 +36,9 @@ export type CaptureError =
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.
*/
export interface ErrorWithCause {
/**
* The native error's code.
@@ -143,8 +146,9 @@ 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 nativeError The native error instance. This is a JSON in the legacy native module architecture.
* @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
* @method
*/
export const tryParseNativeCameraError = <T>(nativeError: T): (CameraRuntimeError | CameraCaptureError) | T => {
if (isCameraErrorJson(nativeError)) {