(
/**
* The type of part to create.
*/
type: Type,
/**
* Parameters specific to the part type being created.
*/
params: Omit<Extract<Part, { type: Type }>, PartTypeId | "type" | "options"> & {
/**
* Optional provider-specific options for this part.
*/
readonly options?: Extract<Part, { type: Type }>["options"] | undefined
}
)
| 211 | * @category Constructors |
| 212 | */ |
| 213 | export const makePart = <const Type extends Part["type"]>( |
| 214 | /** |
| 215 | * The type of part to create. |
| 216 | */ |
| 217 | type: Type, |
| 218 | /** |
| 219 | * Parameters specific to the part type being created. |
| 220 | */ |
| 221 | params: Omit<Extract<Part, { type: Type }>, PartTypeId | "type" | "options"> & { |
| 222 | /** |
| 223 | * Optional provider-specific options for this part. |
| 224 | */ |
| 225 | readonly options?: Extract<Part, { type: Type }>["options"] | undefined |
| 226 | } |
| 227 | ): Extract<Part, { type: Type }> => |
| 228 | ({ |
| 229 | ...params, |
| 230 | [PartTypeId]: PartTypeId, |
| 231 | type, |
| 232 | options: params.options ?? {} |
| 233 | }) as any |
| 234 | |
| 235 | /** |
| 236 | * A utility type for specifying the parameters required to construct a |
no outgoing calls
no test coverage detected