diff --git a/marionette/marionette.d.ts b/marionette/marionette.d.ts index 196571e7a..5d0875e21 100644 --- a/marionette/marionette.d.ts +++ b/marionette/marionette.d.ts @@ -982,16 +982,55 @@ declare module Marionette { onRemoveChild(childView: any): void; } + /** + * A CompositeView extends from CollectionView to be used as a composite view + * for scenarios where it should represent both a branch and leaf in a tree + * structure, or for scenarios where a collection needs to be rendered within + * a wrapper template. + */ class CompositeView extends CollectionView { - constructor(options?: any); + constructor(options?: CollectionViewOptions); - itemView: any; - itemViewContainer: string; + /** + * Each childView will be rendered using the childView's template. The + * CompositeView's template is rendered and the childView's templates are + * added to this. + */ + childView: any; - render(): CompositeView; - appendHtml(cv: any, iv: any); - renderModel(): any; + /** + * By default the composite view uses the same attachHtml method that the + * collection view provides. This means the view will call jQuery's + * .append to move the HTML contents from the child view instance in to + * the collection view's el. + * This is typically not very useful as a composite view will usually render + * a container DOM element in which the child views should be placed. + * This can be either a string or a function returning a string. + */ + childViewContainer: any; + + render(): CompositeView; + + /** + * Invoked before the model has been rendered + */ + onBeforeRenderTemplate(): void; + + /** + * Invoked after the model has been rendered. + */ + onRenderTemplate(): void; + + /** + * Invoked before the collection of models is rendered + */ + onBeforeRenderCollection(): void; + + /** + * Invoked after the collection of models has been rendered + */ + onRenderCollection(): void; } class LayoutView extends ItemView {