1
0
Fork 0
freesewing/markdown/dev/reference/api/design/en.md
2021-10-17 18:26:00 +02:00

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 configuration
  • plugins : Either a plugin object, or an array of plugin objects
  • conditionalPlugins : 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.