Skip to content

Commit

Permalink
chore: more explicit types
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Dec 22, 2023
1 parent 59ff85f commit 5ff1b02
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const builtInCommands = {
};

/** @internal */
export const getRegisteredCommandNamesSymbol = Symbol();
export const getRegisteredCommandNamesSymbol: unique symbol = Symbol();

/**
* Underlying builder API for executing commands.
Expand Down Expand Up @@ -483,7 +483,7 @@ export class CommandBuilder implements PromiseLike<CommandResult> {
}

/** @internal */
[getRegisteredCommandNamesSymbol]() {
[getRegisteredCommandNamesSymbol](): string[] {
return Object.keys(this.#state.commands);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export class PathRef {
}

/** @internal */
static [Symbol.hasInstance](instance: any) {
static [Symbol.hasInstance](instance: any): boolean {
// this should never change because it should work accross versions
return instance?.constructor?.instanceofSymbol === PathRef.instanceofSymbol;
}

/** @internal */
[Symbol.for("Deno.customInspect")]() {
[Symbol.for("Deno.customInspect")](): string {
return `PathRef("${this.#path}")`;
}

Expand Down
4 changes: 2 additions & 2 deletions src/pipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class PipedBuffer implements WriterSync {
this.#inner = new Buffer();
}

getBuffer() {
getBuffer(): Buffer | undefined {
if (this.#inner instanceof Buffer) {
return this.#inner;
} else {
Expand All @@ -143,7 +143,7 @@ export class PipedBuffer implements WriterSync {
}
}

writeSync(p: Uint8Array) {
writeSync(p: Uint8Array): number {
return this.#inner.writeSync(p);
}

Expand Down
4 changes: 2 additions & 2 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface RequestBuilderState {
}

/** @internal */
export const withProgressBarFactorySymbol = Symbol();
export const withProgressBarFactorySymbol: unique symbol = Symbol();

/**
* Builder API for downloading files.
Expand Down Expand Up @@ -197,7 +197,7 @@ export class RequestBuilder implements PromiseLike<RequestResult> {
}

/** @internal */
[withProgressBarFactorySymbol](factory: (message: string) => ProgressBar) {
[withProgressBarFactorySymbol](factory: (message: string) => ProgressBar): RequestBuilder {
return this.#newWithState((state) => {
state.progressBarFactory = factory;
});
Expand Down

0 comments on commit 5ff1b02

Please sign in to comment.