Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmcfarland committed Aug 7, 2024
1 parent b7da250 commit 8be6e89
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ mole.build()

By default, `mole` will look for a file called `mole.config.js` at the root of your project that exports the following object.

```ts
type Config {
theme: 'theme.js',
model?: ['model-name'],
template?: ['template-name'],
output: [
{ css: { file: 'styles.css' } },
{ ios: { file: 'styles.h' } },
{ android: { file: 'styles.xml' } }
],
}
```

You can override the location of the config file by using `mole.config()`.

```js
Expand Down Expand Up @@ -82,14 +69,43 @@ mole.config('src/mole.config.js')

An object that defines where (`file`) and how (`model`, `template`) to process the output. You can set a different `template` or `model` for each output. Name each output by using a key.

### Types

- **`Output`**

```ts
type Output {
file: '', // Where to output the file
model?: '', // Model(s)
template?: '' // Template(s)
name: {
file: string
model?: string,
template?: string
}
}
```

- **`Config`**

```ts
type Config {
theme: string,
model?: string[],
template?: string[],
output: Output
}
```

- **`ModelCallback`**

```ts
type ModelCallback = (theme: object, name: string, str: string) => object
```

**`TemplateCallback`**

```ts
type TemplateCallback = (model: object, theme: object, name: string, str: string) => object
```

## API

- **`mole.config( string | object ): void`**
Expand Down

0 comments on commit 8be6e89

Please sign in to comment.