# Variable layout

layout: {
countFields: (layout: Layout) => number;
eachPage: (layout: Layout, f: any) => Promise<void>;
eachView: (layout: Layout, f: any, state?: any) => Promise<void>;
findLayoutBranchWith: (
layouts: Layout[],
pred: (l1: Layout) => boolean,
) => Layout | undefined;
getStringsForI18n: (layout: Layout) => string[];
getViews: (layout: Layout) => Promise<any[]>;
splitLayoutContainerFields: (
layout: Layout,
) => { inner: undefined; outer: (newContents: Layout) => Layout };
translateLayout: (layout: Layout, locale: string) => void;
traverse: (layout: Layout, visitors: Visitors) => Promise<void>;
traverseSync: (layout: Layout, visitors: Function | Visitors) => void;
}

#### Type Declaration

- ##### countFields: (layout: Layout) => number

- ##### eachPage: (layout: Layout, f: any) => Promise<void>

  execute a function on each page in the layout

- ##### eachView: (layout: Layout, f: any, state?: any) => Promise<void>

  execute a function on each view in the layout

- ##### findLayoutBranchWith: (layouts: Layout[], pred: (l1: Layout) => boolean) => Layout | undefined

- ##### getStringsForI18n: (layout: Layout) => string[]

- ##### getViews: (layout: Layout) => Promise<any[]>

- ##### splitLayoutContainerFields: (layout: Layout) => { inner: undefined; outer: (newContents: Layout) => Layout }

- ##### translateLayout: (layout: Layout, locale: string) => void

- ##### traverse: (layout: Layout, visitors: Visitors) => Promise<void>

- ##### traverseSync: (layout: Layout, visitors: Function | Visitors) => void

- Defined in packages/saltcorn-data/models/layout.ts:304