Defining methods for a plugin

Defining methods for a plugin

I'm not very confortable with the proposed solution to add methods to a plugin.  According to http://docs.jquery.com/Plugins/Authoring, you should use the pattern  .plugin("method", options).

Why not creating a generic api plugin to be able to use this  structure:
var api = $(...).plugin().api();
api.method(options);

The generic api plugin should just return this.data('api'), and the plugin developer would be responsible of setting this.data('api', methods) when necessary.

Regards,
G.