chore: update ts parser for description comment fixes and generic types (#28709)
* chore: update ts parser for description comment fixes * docs: strongly type the getUserDefault API * spec: add getUserMedia type assertions to smoke run
This commit is contained in:
parent
ac9ec1a6ea
commit
400d7c4bce
6 changed files with 56 additions and 19 deletions
12
docs/api/structures/user-default-types.md
Normal file
12
docs/api/structures/user-default-types.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# UserDefaultTypes Object
|
||||
|
||||
* `string` String
|
||||
* `boolean` Boolean
|
||||
* `integer` Number
|
||||
* `float` Number
|
||||
* `double` Number
|
||||
* `url` String
|
||||
* `array` Array\<unknown>
|
||||
* `dictionary` Record\<string, unknown>
|
||||
|
||||
This type is a helper alias, no object will never exist of this type.
|
|
@ -159,13 +159,13 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.
|
|||
|
||||
Add the specified defaults to your application's `NSUserDefaults`.
|
||||
|
||||
### `systemPreferences.getUserDefault(key, type)` _macOS_
|
||||
### `systemPreferences.getUserDefault<Type extends keyof UserDefaultTypes>(key, type)` _macOS_
|
||||
|
||||
* `key` String
|
||||
* `type` String - Can be `string`, `boolean`, `integer`, `float`, `double`,
|
||||
* `type` Type - Can be `string`, `boolean`, `integer`, `float`, `double`,
|
||||
`url`, `array` or `dictionary`.
|
||||
|
||||
Returns `any` - The value of `key` in `NSUserDefaults`.
|
||||
Returns [`UserDefaultTypes[Type]`](structures/user-default-types.md) - The value of `key` in `NSUserDefaults`.
|
||||
|
||||
Some popular `key` and `type`s are:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue