(
/**
* The type of part to create.
*/
type: Type,
/**
* Parameters specific to the part type being created.
*/
params: Omit<Extract<Part, { type: Type }>, typeof PartTypeId | "type" | "options"> & {
/**
* Optional provider-specific options for this part.
*/
readonly options?: Extract<Part, { type: Type }>["options"] | undefined
}
)
| 172 | * @since 4.0.0 |
| 173 | */ |
| 174 | export const makePart = <const Type extends Part["type"]>( |
| 175 | /** |
| 176 | * The type of part to create. |
| 177 | */ |
| 178 | type: Type, |
| 179 | /** |
| 180 | * Parameters specific to the part type being created. |
| 181 | */ |
| 182 | params: Omit<Extract<Part, { type: Type }>, typeof PartTypeId | "type" | "options"> & { |
| 183 | /** |
| 184 | * Optional provider-specific options for this part. |
| 185 | */ |
| 186 | readonly options?: Extract<Part, { type: Type }>["options"] | undefined |
| 187 | } |
| 188 | ): Extract<Part, { type: Type }> => (({ |
| 189 | ...params, |
| 190 | [PartTypeId]: PartTypeId, |
| 191 | type, |
| 192 | options: params.options ?? {} |
| 193 | }) as any) |
| 194 | |
| 195 | /** |
| 196 | * A utility type for specifying the parameters required to construct a |
no outgoing calls
no test coverage detected