From 78d74573c835c65bed9e655f7e523eeea109c82e Mon Sep 17 00:00:00 2001 From: snow flurry Date: Thu, 30 Jul 2026 22:50:43 -0700 Subject: [PATCH] Change ConfigItem to ClayItem ConfigItem isn't a type, and the methods referencing ConfigItem are actually returning ClayItem. Closes #35. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b15e7f5..894e5aa 100755 --- a/README.md +++ b/README.md @@ -986,11 +986,11 @@ This is the main way of talking to your generated config page. An instance of th | Method | Returns | |--------|---------| -| `.getAllItems()` | `Array.` - an array of all config items. | -| `.getItemByMessageKey( [string] messageKey )` | `ConfigItem\|undefined` - a single `ConfigItem` that has the provided `messageKey`, otherwise `undefined`. | -| `.getItemById( [string] id )` | `ConfigItem\|undefined` - a single `ConfigItem` that has the provided `id`, otherwise `undefined`. | -| `.getItemsByType( [string] type )` | `Array.` - an array of config items that match the provided `type`. | -| `.getItemsByGroup( [string] group )` | `Array.` - an array of config items that match the provided `group`. | +| `.getAllItems()` | `Array.` - an array of all config items. | +| `.getItemByMessageKey( [string] messageKey )` | `ClayItem\|undefined` - a single `ClayItem` that has the provided `messageKey`, otherwise `undefined`. | +| `.getItemById( [string] id )` | `ClayItem\|undefined` - a single `ClayItem` that has the provided `id`, otherwise `undefined`. | +| `.getItemsByType( [string] type )` | `Array.` - an array of config items that match the provided `type`. | +| `.getItemsByGroup( [string] group )` | `Array.` - an array of config items that match the provided `group`. | | `.serialize()` | `Object` - an object representing all items with an `messageKey` where the key is the `messageKey` and the value is an object with the `value` property set to the result of running `.get()` on the Clay item. If the Clay item has a `precision` property set, it is included in the object | | `.build()`
Builds the config page. Will dispatch the `BEFORE_BUILD` event prior to building the page, then the `AFTER_BUILD` event once it is complete. If the config page has already been built, then the `ClayConfig.destroy()` method will be executed prior to building the page again. | `ClayConfig` | | `.destroy()`
Destroys the config page. Will dispatch the `BEFORE_DESTROY` event prior to destroying the page, then the `AFTER_DESTROY` event once it is complete. This method wipes the config page completely, including all existing items. You will need to make sure that you re-attach your event handlers for any items that are replaced | `ClayConfig` | @@ -1018,7 +1018,7 @@ This is the main way of talking to your generated config page. An instance of th | Method | Returns | |--------|---------| -| `.initialize( [ClayConfig] clay)`
You shouldn't ever need to run this method manually as it will automatically be called when the config is built. | `ConfigItem` | +| `.initialize( [ClayConfig] clay)`
You shouldn't ever need to run this method manually as it will automatically be called when the config is built. | `ClayItem` | | `.on( [string] events, [function] handler )`
Register an event to the provided handler. The handler will be called with this instance of `ClayItem` as the context. If you wish to register multiple events to the same handler, then separate the events with a space. Events will be registered against the `$manipulatorTarget` so most DOM events such as **"change"** or **"click"** can be listened for. | `ClayItem` | | `.off( [function] handler )`
Remove the given event handler. **NOTE:** This will remove the handler from all registered events. | `ClayItem` | | `.trigger( [string] name, [object] eventObj={} )`
Trigger the provided event and optionally pass extra data to the handler. | `ClayItem` |