Skip to content

Commit

Permalink
fix: switch interface method decl style
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 3, 2023
1 parent 41f008b commit a33d24f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/bases/interface.ts
Expand Up @@ -11,7 +11,7 @@ export interface BaseEncoder {
*
* @param bytes
*/
baseEncode: (bytes: Uint8Array) => string
baseEncode(bytes: Uint8Array): string
}

/**
Expand All @@ -24,7 +24,7 @@ export interface BaseDecoder {
*
* @param text
*/
baseDecode: (text: string) => Uint8Array
baseDecode(text: string): Uint8Array
}

/**
Expand Down Expand Up @@ -60,7 +60,7 @@ export interface MultibaseEncoder<Prefix extends string> {
* Encodes binary data into **multibase** string (which will have a
* prefix added).
*/
encode: (bytes: Uint8Array) => Multibase<Prefix>
encode(bytes: Uint8Array): Multibase<Prefix>
}

/**
Expand All @@ -76,7 +76,7 @@ export interface MultibaseDecoder<Prefix extends string> {
*
* @param multibase
*/
decode: (multibase: Multibase<Prefix>) => Uint8Array
decode(multibase: Multibase<Prefix>): Uint8Array
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/block/interface.ts
Expand Up @@ -68,7 +68,7 @@ export interface BlockView<
cid: CID<T, C, A, V>
value: T

links: () => Iterable<[string, CID]>
tree: () => Iterable<string>
get: (path: string) => BlockCursorView<unknown>
links(): Iterable<[string, CID]>
tree(): Iterable<string>
get(path: string): BlockCursorView<unknown>
}
4 changes: 2 additions & 2 deletions src/codecs/interface.ts
Expand Up @@ -6,15 +6,15 @@ import type { ByteView } from '../block/interface.js'
export interface BlockEncoder<Code extends number, T> {
name: string
code: Code
encode: (data: T) => ByteView<T>
encode(data: T): ByteView<T>
}

/**
* IPLD decoder part of the codec.
*/
export interface BlockDecoder<Code extends number, T> {
code: Code
decode: (bytes: ByteView<T>) => T
decode(bytes: ByteView<T>): T
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/hashes/interface.ts
Expand Up @@ -44,7 +44,7 @@ export interface MultihashHasher<Code extends number = number> {
*
* @param {Uint8Array} input
*/
digest: (input: Uint8Array) => Promise<MultihashDigest<Code>> | MultihashDigest<Code>
digest(input: Uint8Array): Promise<MultihashDigest<Code>> | MultihashDigest<Code>

/**
* Name of the multihash
Expand All @@ -68,5 +68,5 @@ export interface MultihashHasher<Code extends number = number> {
* impractical e.g. implementation of Hash Array Mapped Trie (HAMT).
*/
export interface SyncMultihashHasher<Code extends number = number> extends MultihashHasher<Code> {
digest: (input: Uint8Array) => MultihashDigest<Code>
digest(input: Uint8Array): MultihashDigest<Code>
}
8 changes: 4 additions & 4 deletions src/link/interface.ts
Expand Up @@ -33,12 +33,12 @@ export interface Link<
readonly byteLength: number
readonly bytes: ByteView<Link<Data, Format, Alg, V>>

equals: (other: unknown) => other is Link<Data, Format, Alg, Version>
equals(other: unknown): other is Link<Data, Format, Alg, Version>

toString: <Prefix extends string>(base?: MultibaseEncoder<Prefix>) => ToString<Link<Data, Format, Alg, Version>, Prefix>
link: () => Link<Data, Format, Alg, V>
toString<Prefix extends string>(base?: MultibaseEncoder<Prefix>): ToString<Link<Data, Format, Alg, Version>, Prefix>
link(): Link<Data, Format, Alg, V>

toV1: () => Link<Data, Format, Alg, 1>
toV1(): Link<Data, Format, Alg, 1>
}

export interface LinkJSON<T extends UnknownLink = UnknownLink> {
Expand Down

0 comments on commit a33d24f

Please sign in to comment.