2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-12-27 17:33:49 +01:00
|
|
|
title: "@freesewing/core API"
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
This is the documentation for FreeSewing's core library, published as `@freesewing/core` on NPM.
|
2022-02-19 08:04:25 +01:00
|
|
|
It's a complete toolbox for parametric design with a primary focus on
|
2021-09-25 17:05:18 +02:00
|
|
|
sewing patterns, but can be utilized for a variety of similar 2D design tasks.
|
|
|
|
|
|
|
|
## Getting started
|
|
|
|
|
|
|
|
To get started, import the library:
|
|
|
|
|
2021-08-25 16:09:31 +02:00
|
|
|
```js
|
|
|
|
import freesewing from '@freesewing/core'
|
|
|
|
```
|
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
<Tip>
|
|
|
|
|
2022-02-19 08:04:25 +01:00
|
|
|
This is the reference documentation. For a more hands-on walkthrough,
|
2021-09-25 17:05:18 +02:00
|
|
|
please refer to our [pattern design tutorial](/tutorials/pattern-design/)
|
|
|
|
|
|
|
|
</Tip>
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
2021-08-25 16:09:31 +02:00
|
|
|
The `@freesewing/core` default export is a single object with the following properties:
|
|
|
|
|
2022-02-20 14:44:38 +01:00
|
|
|
- `Design`: The [Design constructor](/reference/api/design/) to create a new design
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
<Note>
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-19 08:04:25 +01:00
|
|
|
You will typically use the `Design()` constructor.\
|
|
|
|
The other constructors and utilities below are exported to facilitate unit testing.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-09-25 17:05:18 +02:00
|
|
|
</Note>
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-20 14:44:38 +01:00
|
|
|
- `Path`: The [Path constructor](/reference/api/path) to create a new path
|
|
|
|
- `Pattern`: The [Pattern constructor](/reference/api/pattern) to create a new pattern
|
|
|
|
- `Point`: The [Point constructor](/reference/api/point) to create a new point
|
|
|
|
- `Snippet`: The [Snippet constructor](/reference/api/snippet) to create a new snippet
|
|
|
|
- `utils`: A collection of [utilities](/reference/api/utils)
|
|
|
|
- `version`: A string containing the `@freesewing/core` version number
|