Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix the docs issues #549

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"shx": "^0.3.4"
},
"devDependencies": {
"@gnd/typedoc": "^0.15.0-0",
"@types/chai": "^4.3.4",
"@types/fs-extra": "^9.0.13",
"@types/mocha": "^10.0.0",
Expand All @@ -51,6 +50,7 @@
"rocha": "^2.5.10",
"semver": "^7.3.8",
"ts-node": "~10.9.1",
"typedoc": "^0.23.21",
"typescript": "~4.9.3",
"weak-napi": "^2.0.2",
"which": "^3.0.0"
Expand Down Expand Up @@ -84,7 +84,7 @@
"build.library": "tsc -p ./src/tsconfig.json && run-s build.library.compat",
"build.script": "tsc -p ./script/tsconfig.json",
"build.js": "run-p build.script build.library",
"build.doc": "typedoc --options ./typedoc.json --tsconfig ./tsconfig.docs.json && minify-all -s docs-raw -d docs --jsCompressor terser",
"build.doc": "typedoc --options ./typedoc.json && minify-all -s docs-raw -d docs --jsCompressor terser",
"deploy.doc": "run-s build.doc && gh-pages --dist \"./docs\"",
"prebuild": "run-s build.js && node ./script/prebuild.js",
"build.native": "node-gyp configure --release && node-gyp build --release",
Expand Down
106 changes: 31 additions & 75 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function asyncIterator<T extends SocketLikeIterable<U>, U>(this: T) {
Object.assign(Socket.prototype, {[Symbol.asyncIterator]: asyncIterator})
Object.assign(Observer.prototype, {[Symbol.asyncIterator]: asyncIterator})

interface EventSubscriber {
export interface EventSubscriber {
/**
* Adds a listener function which will be invoked when the given event type is
* observed. Calling this method will convert the {@link Observer} to **event
Expand Down Expand Up @@ -1374,7 +1374,7 @@ export class Router extends Socket {
}
}

interface RouterConnectOptions {
export interface RouterConnectOptions {
routingId?: string
}

Expand Down Expand Up @@ -1582,7 +1582,7 @@ export class Stream extends Socket {
}
}

interface StreamConnectOptions {
export interface StreamConnectOptions {
routingId?: string
}

Expand Down
14 changes: 7 additions & 7 deletions src/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ interface ErrnoError extends Error {
errno: number
}

interface AuthError extends Error {
export interface AuthError extends Error {
status: 300 | 400 | 500
}

interface ProtoError extends Error {
export interface ProtoError extends Error {
code:
| "ERR_ZMTP_UNSPECIFIED"
| "ERR_ZMTP_UNEXPECTED_COMMAND"
Expand All @@ -145,19 +145,19 @@ interface ProtoError extends Error {
| "ERR_ZAP_INVALID_METADATA"
}

interface EventAddress {
export interface EventAddress {
address: string
}

interface EventInterval {
export interface EventInterval {
interval: number
}

interface EventError<E = ErrnoError> {
export interface EventError<E = ErrnoError> {
error: E
}

type EventFor<T extends string, D = {}> = Expand<{type: T} & D>
export type EventFor<T extends string, D = {}> = Expand<{type: T} & D>

/**
* A union type that represents all possible even types and the associated data.
Expand Down Expand Up @@ -630,7 +630,7 @@ type IfEquals<X, Y, A, B = never> = (<T>() => T extends X ? 1 : 2) extends <
: B

/* https://stackoverflow.com/questions/57683303 */
type Expand<T> = T extends infer O ? {[K in keyof O]: O[K]} : never
export type Expand<T> = T extends infer O ? {[K in keyof O]: O[K]} : never

/** @internal */
export type ReadableKeys<T> = {
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@
"./src/index.ts"
]
}
}
},
"exclude": [
"script/**/*",
"test/**/*",
"examples/**/*",
"src/errors.ts",
"src/util.ts"
]
}
6 changes: 2 additions & 4 deletions typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
"entryPoints": [
"./src/index.ts"
],
"tsconfig": " ./tsconfig.docs.json",
"tsconfig": "./tsconfig.docs.json",
"out": "docs-raw",
"excludePrivate": true,
"excludeNotExported": true,
"excludeExternals": true,
"excludeExternals": false,
"exclude": [
"script/**/*",
"test/**/*",
"examples/**/*",
"src/+(draft|native|compat).ts",
"src/errors.ts",
"src/util.ts"
],
Expand Down