@salesforce/ts-types 1.7.1 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2022, Salesforce.com, Inc.
1
+ Copyright (c) 2023, Salesforce.com, Inc.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -2,22 +2,22 @@ import { AnyConstructor, Dictionary, Nullable, Optional, View } from '../types';
2
2
  /**
3
3
  * @ignore
4
4
  */
5
- export declare type PrimitiveType = 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
5
+ export type PrimitiveType = 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
6
6
  /**
7
7
  * @ignore
8
8
  */
9
- export declare type VerifiableType = PrimitiveType | AnyConstructor;
9
+ export type VerifiableType = PrimitiveType | AnyConstructor;
10
10
  /**
11
11
  * @ignore
12
12
  */
13
- export declare type PropertyShape = {
13
+ export type PropertyShape = {
14
14
  type: VerifiableType;
15
15
  optional: boolean;
16
16
  };
17
17
  /**
18
18
  * @ignore
19
19
  */
20
- export declare type ObjectShape = Dictionary<VerifiableType | PropertyShape>;
20
+ export type ObjectShape = Dictionary<VerifiableType | PropertyShape>;
21
21
  /**
22
22
  * @ignore
23
23
  */
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * An alias for the commonly needed `Extract<keyof T, string>`.
3
3
  */
4
- export declare type KeyOf<T> = Extract<keyof T, string>;
4
+ export type KeyOf<T> = Extract<keyof T, string>;
5
5
  /**
6
6
  * An alias for a tuple of type `[string, T]' for a given generic type `T`. `T` defaults to `unknown` if not otherwise
7
7
  * defined.
8
8
  */
9
- export declare type KeyValue<T = unknown> = [string, T];
9
+ export type KeyValue<T = unknown> = [string, T];
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * Subtracts `undefined` from any union type `T`. This is the opposite of {@link Optional}.
6
6
  */
7
- export declare type NonOptional<T> = T extends undefined ? never : T;
7
+ export type NonOptional<T> = T extends undefined ? never : T;
8
8
  /**
9
9
  * Converts a type `T` that may have optional properties into a type `T` with only required
10
10
  * properties (e.g. `undefined` values are not allowed). Explicit `null`s in value unions
@@ -17,7 +17,7 @@ export declare type NonOptional<T> = T extends undefined ? never : T;
17
17
  * // RequiredNonOptionalFoo -> { bar: string | null };
18
18
  * ```
19
19
  */
20
- export declare type RequiredNonOptional<T> = T extends object ? {
20
+ export type RequiredNonOptional<T> = T extends object ? {
21
21
  [P in keyof T]-?: NonOptional<T[P]>;
22
22
  } : T;
23
23
  /**
@@ -30,14 +30,14 @@ export declare type RequiredNonOptional<T> = T extends object ? {
30
30
  * // RequiredNonNullableFoo -> { bar: string };
31
31
  * ```
32
32
  */
33
- export declare type RequiredNonNullable<T> = T extends object ? Required<{
33
+ export type RequiredNonNullable<T> = T extends object ? Required<{
34
34
  [P in keyof T]: NonNullable<T[P]>;
35
35
  }> : T;
36
36
  /**
37
37
  * Extracts literally defined property names from a type `T` as a union of key name strings, minus
38
38
  * any index signatures.
39
39
  */
40
- export declare type Literals<T> = Extract<{
40
+ export type Literals<T> = Extract<{
41
41
  [K in keyof T]: string extends K ? never : number extends K ? never : K;
42
42
  } extends {
43
43
  [_ in keyof T]: infer U;
@@ -4,8 +4,8 @@
4
4
  /**
5
5
  * Any `function` returning type `T`. `T` defaults to `unknown` when not explicitly supplied.
6
6
  */
7
- export declare type AnyFunction<T = unknown> = (...args: any[]) => T;
7
+ export type AnyFunction<T = unknown> = (...args: any[]) => T;
8
8
  /**
9
9
  * A constructor for any type `T`. `T` defaults to `object` when not explicitly supplied.
10
10
  */
11
- export declare type AnyConstructor<T = object> = new (...args: any[]) => T;
11
+ export type AnyConstructor<T = object> = new (...args: any[]) => T;
@@ -5,15 +5,15 @@ import { Dictionary } from './collection';
5
5
  /**
6
6
  * Any valid JSON primitive value.
7
7
  */
8
- export declare type JsonPrimitive = null | boolean | number | string;
8
+ export type JsonPrimitive = null | boolean | number | string;
9
9
  /**
10
10
  * Any valid JSON collection value.
11
11
  */
12
- export declare type JsonCollection = JsonMap | JsonArray;
12
+ export type JsonCollection = JsonMap | JsonArray;
13
13
  /**
14
14
  * Any valid JSON value.
15
15
  */
16
- export declare type AnyJson = JsonPrimitive | JsonCollection;
16
+ export type AnyJson = JsonPrimitive | JsonCollection;
17
17
  /**
18
18
  * Any JSON-compatible object.
19
19
  */
@@ -36,22 +36,22 @@ import { Literals } from './conditional';
36
36
  * // }
37
37
  * ```
38
38
  */
39
- export declare type LiteralsRecord<T, U> = Record<Literals<T>, U>;
39
+ export type LiteralsRecord<T, U> = Record<Literals<T>, U>;
40
40
  /**
41
41
  * Creates a new type that omits keys in union type `K` of a target type `T`.
42
42
  */
43
- export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
43
+ export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
44
44
  /**
45
45
  * Converts readonly properties of a type `T` to writable properties. This is the opposite of the
46
46
  * `Readonly<T>` builtin mapped type.
47
47
  */
48
- export declare type ReadWrite<T> = {
48
+ export type ReadWrite<T> = {
49
49
  -readonly [K in keyof T]: T[K];
50
50
  };
51
51
  /**
52
52
  * A view over an `object` with constrainable properties.
53
53
  */
54
- export declare type View<K extends string, V = unknown> = {
54
+ export type View<K extends string, V = unknown> = {
55
55
  [_ in K]: V;
56
56
  };
57
57
  /**
@@ -66,6 +66,6 @@ export declare type View<K extends string, V = unknown> = {
66
66
  * // type of NameAndOptionalNumericValue -> { name: string } & { value?: number | undefined }
67
67
  * ```
68
68
  */
69
- export declare type Overwrite<T1, T2> = {
69
+ export type Overwrite<T1, T2> = {
70
70
  [P in Exclude<keyof T1, keyof T2>]: T1[P];
71
71
  } & T2;
@@ -4,13 +4,13 @@
4
4
  /**
5
5
  * A union type for either the parameterized type `T` or `undefined` -- the opposite of {@link NonOptional}.
6
6
  */
7
- export declare type Optional<T> = T | undefined;
7
+ export type Optional<T> = T | undefined;
8
8
  /**
9
9
  * A union type for either the parameterized type `T`, `null`, or `undefined` -- the opposite of
10
10
  * the `NonNullable` builtin conditional type.
11
11
  */
12
- export declare type Nullable<T> = Optional<T | null>;
12
+ export type Nullable<T> = Optional<T | null>;
13
13
  /**
14
14
  * A union type for either the parameterized type `T` or an array of `T`.
15
15
  */
16
- export declare type Many<T> = T | T[];
16
+ export type Many<T> = T | T[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ts-types",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Types and related utilities for TypeScript",
5
5
  "main": "lib/index.js",
6
6
  "repository": "forcedotcom/ts-types",
@@ -26,31 +26,31 @@
26
26
  "test": "sf-test"
27
27
  },
28
28
  "dependencies": {
29
- "tslib": "^2.4.1"
29
+ "tslib": "^2.5.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@salesforce/dev-config": "^3.0.0",
33
33
  "@salesforce/dev-scripts": "^3.1.0",
34
34
  "@salesforce/prettier-config": "^0.0.2",
35
- "@typescript-eslint/eslint-plugin": "^5.41.0",
36
- "@typescript-eslint/parser": "^5.41.0",
37
- "chai": "^4.2.0",
38
- "eslint": "^8.26.0",
39
- "eslint-config-prettier": "^8.5.0",
40
- "eslint-config-salesforce": "^1.1.0",
41
- "eslint-config-salesforce-license": "^0.1.6",
35
+ "@typescript-eslint/eslint-plugin": "^5.48.2",
36
+ "@typescript-eslint/parser": "^5.48.2",
37
+ "chai": "^4.3.7",
38
+ "eslint": "^8.32.0",
39
+ "eslint-config-prettier": "^8.6.0",
40
+ "eslint-config-salesforce": "^1.1.1",
41
+ "eslint-config-salesforce-license": "^0.2.0",
42
42
  "eslint-config-salesforce-typescript": "^1.1.1",
43
43
  "eslint-plugin-header": "^3.0.0",
44
- "eslint-plugin-import": "2.26.0",
45
- "eslint-plugin-jsdoc": "^39.3.25",
44
+ "eslint-plugin-import": "2.27.5",
45
+ "eslint-plugin-jsdoc": "^39.6.7",
46
46
  "eslint-plugin-prefer-arrow": "^1.2.1",
47
47
  "husky": "^7.0.4",
48
48
  "mocha": "^9.1.3",
49
49
  "nyc": "^15.1.0",
50
- "prettier": "^2.7.1",
50
+ "prettier": "^2.8.3",
51
51
  "pretty-quick": "^3.1.0",
52
52
  "sinon": "10.0.0",
53
53
  "ts-node": "^10.0.0",
54
- "typescript": "^4.8.4"
54
+ "typescript": "^4.9.4"
55
55
  }
56
56
  }