1.2 KiB
1.2 KiB
title | order |
---|---|
Design | 10 |
The Design
object in FreeSewing's core library serves a single purpose:
To instantiate new pattern designs.
Design constructor
function freesewing.Design(
object config,
object|array plugins, // optional
object|array conditionalPlugins // optional
)
This constructor creates a new pattern design. It takes the following arguments:
config
: The pattern configurationplugins
: Either a plugin object, or an array of plugin objectsconditionalPlugins
: Either a conditional plugin object, or an array of conditional plugin objects to (conditionally) load in your pattern
import freesewing from "@freesewing/core"
import plugins from "@freesewing/plugin-bundle"
import config from "../config"
// Create new design
const Sorcha = new freesewing.Design(config, plugins)
This method is a super-constructor. It will return a constructor method that will become the default export of your design and should be called to instantiate your pattern.
See creating a new pattern design for a complete example.