@infra-blocks/types 0.22.0 → 0.23.0

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.
@@ -69,6 +69,17 @@ export type Primitive = bigint | boolean | null | number | string | symbol | und
69
69
  * It's an alias for MapKeys<M, unknown>.
70
70
  */
71
71
  export type SameKeys<M> = MapKeys<M, unknown>;
72
+ /**
73
+ * A type representing all types that can be used in a vanilla template literal.
74
+ *
75
+ * It includes all primitive types except symbols, which throw a {@link TypeError} when
76
+ * used directly in a template literal. It also includes objects, which will use
77
+ * various possible implementations. The default one is rather useless, however,
78
+ * as it only produces the string "[object Object]".
79
+ *
80
+ * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion
81
+ */
82
+ export type TemplateExpression = Exclude<Primitive, symbol> | object;
72
83
  /**
73
84
  * A convenience type mapping that transitively make partial fields optional.
74
85
  *
@@ -69,6 +69,17 @@ export type Primitive = bigint | boolean | null | number | string | symbol | und
69
69
  * It's an alias for MapKeys<M, unknown>.
70
70
  */
71
71
  export type SameKeys<M> = MapKeys<M, unknown>;
72
+ /**
73
+ * A type representing all types that can be used in a vanilla template literal.
74
+ *
75
+ * It includes all primitive types except symbols, which throw a {@link TypeError} when
76
+ * used directly in a template literal. It also includes objects, which will use
77
+ * various possible implementations. The default one is rather useless, however,
78
+ * as it only produces the string "[object Object]".
79
+ *
80
+ * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion
81
+ */
82
+ export type TemplateExpression = Exclude<Primitive, symbol> | object;
72
83
  /**
73
84
  * A convenience type mapping that transitively make partial fields optional.
74
85
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/types",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Typescript types utility package.",
5
5
  "keywords": [
6
6
  "type",