Skip to content

Commit

Permalink
feat: add interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
agsh committed Jun 28, 2024
1 parent 48d5f43 commit dc44d51
Show file tree
Hide file tree
Showing 42 changed files with 12,042 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DiscoverySingleton extends EventEmitter {
* discovery.on('device', console.log);
* ```
*/
static device: 'device' = 'device';
static device = 'device' as const;
/**
* Indicates any errors
* @param error Error instance or array of error instances from {@link Error}
Expand All @@ -52,7 +52,7 @@ export class DiscoverySingleton extends EventEmitter {
* discovery.on('error', console.error);
* ```
*/
static error: 'error' = 'error';
static error = 'error' as const;

private static instance?: DiscoverySingleton;

Expand Down Expand Up @@ -88,7 +88,7 @@ export class DiscoverySingleton extends EventEmitter {
* console.log(await cams[0]?.getSystemDateAndTime());
* })();
*/
probe(options: DiscoveryOptions): Promise<(Onvif | Record<string, unknown>)[]> {
probe(options: DiscoveryOptions = {}): Promise<(Onvif | Record<string, unknown>)[]> {
return new Promise((resolve, reject) => {
const cams: Map<string, Onvif | Record<string, unknown>> = new Map();
const errors: Error[] = [];
Expand Down
Loading

0 comments on commit dc44d51

Please sign in to comment.