Skip to content

Commit 9729992

Browse files
committedApr 15, 2023
fix: adjust more docs
1 parent 786fa82 commit 9729992

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed
 

‎.changeset/silver-radios-smile.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'standard-log-color': patch
3+
'standard-log': patch
4+
---
5+
6+
Adjust jsdoc.
7+
8+
Remove the `import { ... } from 'standard-log'` from the examples.
9+
This allows the type and docs to be reused when other packages exports the types or instances.

‎packages/color/ts/supportColor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ let value: supportColor.Result
3131
/**
3232
* Detects if the platform supports color.
3333
* For browser, the value can only be:
34-
* - `{ stdout: 0, stderr: 0 }`, or
35-
* - `{ stdout: 3, stderr: 3 }`.
34+
* - `{ stdout: 0, stderr: 0 }` (DISABLED), or
35+
* - `{ stdout: 3, stderr: 3 }` (TRUE).
3636
* So you only need to check one case.
3737
* The result value is made the same so that it can be used in all platforms.
3838
*/

‎packages/color/ts/types.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ export type CssFormatterOptions = {
77
* Default to 20.
88
*/
99
maxColor?: number
10+
/**
11+
* Style of the timestamp.
12+
* Defaults to `none`.
13+
*
14+
* - `none`: no timestamp.
15+
* - `iso`: in iso format.
16+
* - `long`: as elapsed time.
17+
*/
1018
timestamp?: TimestampFormat
1119
/**
1220
* style of the id block.
13-
* Defaults to `padding: 2px; margin: 2px; line-height: 1.8em;`
21+
* Defaults to `padding: 2px; line-height: 1rem;`
1422
*/
1523
style?: string
1624
}
@@ -19,7 +27,7 @@ export type ColorLogReporterOptions = ConsoleLogReporterOptions & {
1927
/**
2028
* CSS formatter options.
2129
* This can be used to specify the CSS formatter options in the browser,
22-
* IF you do not specify your own `formatter`.
30+
* If you do not specify your own `formatter`.
2331
*/
2432
cssFormatterOptions?: CssFormatterOptions
2533
}

‎packages/log/ts/types.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ export interface StandardLogInstance<N extends string = LogMethodNames> {
8989
* Get a logger instance with the specified id.
9090
*
9191
* ```ts
92-
* import { createStandardLog } from 'standard-log'
93-
*
94-
* const sl = createStandardLog()
9592
* const logger = sl.getLogger('my-logger')
9693
*
9794
* logger.info('Hello world!') // 2020-01-01T00:00:00.000Z my-logger (INFO) Hello world!
@@ -101,15 +98,12 @@ export interface StandardLogInstance<N extends string = LogMethodNames> {
10198
/**
10299
* Get a non-console logger instance with the specified id.
103100
*
104-
* The resulting logger will only write to the reporters that are not console reporters.
101+
* The resulting logger will only send to the reporters that are not console reporters.
105102
*
106103
* ```ts
107-
* import { createStandardLog } from 'standard-log'
108-
*
109-
* const sl = createStandardLog({ reporter: [createConsoleReporter(), createRemoteReporter(...)] })
110104
* const logger = sl.getNonConsoleLogger('my-logger')
111105
*
112-
* logger.info('Hello world!') // will only write to remote reporter
106+
* logger.info('Hello world!') // will not send to any console reporter
113107
* ```
114108
*/
115109
getNonConsoleLogger(id: string, options?: LoggerOptions): Logger<N | LogMethodNames>

0 commit comments

Comments
 (0)
Please sign in to comment.