@panneau/core 4.0.37 → 4.0.40-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
+ import { ElementType, ReactNode } from 'react';
1
2
  import EventEmitter from 'wolfy87-eventemitter';
2
3
  import { Tracking as Tracking$1 } from '@folklore/tracking';
3
- import { ReactNode } from 'react';
4
4
  import { MessageDescriptor } from 'react-intl';
5
5
 
6
6
  declare class ComponentsManager {
7
- components: Record<string, unknown>;
8
- constructor(components?: Record<string, unknown>);
9
- addComponent(name: string, component: unknown, namespace?: string | null): this;
10
- addComponents(components: Record<string, unknown>, namespace?: string | null): this;
7
+ components: Record<string, ElementType>;
8
+ constructor(components?: Record<string, ElementType>);
9
+ addComponent(name: string, component: ElementType, namespace?: string | null): this;
10
+ addComponents(components: Record<string, ElementType>, namespace?: string | null): this;
11
11
  merge(manager: ComponentsManager, namespace?: string | null): this;
12
12
  addNamespace(namespace: string | null): this;
13
- getComponent(name: string, namespace?: string | null): unknown;
14
- getComponents(namespace?: string | null): Record<string, unknown> | null;
13
+ getComponent(name: string, namespace?: string | null): ElementType | null;
14
+ getComponents(namespace?: string | null): Record<string, ElementType> | null;
15
15
  hasComponent(name: string, namespace?: string | null): boolean;
16
16
  }
17
17
 
@@ -276,6 +276,12 @@ type TrackingVariables = Record<string, unknown>;
276
276
  * Trigger update identifier
277
277
  */
278
278
  type TriggerUpdate = string;
279
+ interface Pagination {
280
+ page: number;
281
+ count: number;
282
+ total: number;
283
+ last_page: number;
284
+ }
279
285
 
280
286
  /**
281
287
  * User definition
@@ -367,11 +373,19 @@ interface ResourceIntl {
367
373
  /**
368
374
  * Resource definition
369
375
  */
376
+ interface ResourceIndex {
377
+ filters?: Filter[];
378
+ columns?: TableColumn[];
379
+ actions?: ActionDefinition[];
380
+ fields?: Field[];
381
+ [key: string]: unknown;
382
+ }
370
383
  interface Resource {
371
384
  id: string;
372
385
  name: string;
373
386
  intl?: ResourceIntl;
374
387
  fields?: Field[];
388
+ index?: ResourceIndex;
375
389
  forms?: Record<string, unknown>;
376
390
  shows_in_navbar?: boolean;
377
391
  settings?: Record<string, unknown>;
@@ -383,10 +397,13 @@ interface Item {
383
397
  id: string;
384
398
  [key: string]: unknown;
385
399
  }
400
+ interface ResourceItem extends Item {
401
+ type?: string;
402
+ }
386
403
  /**
387
404
  * Media file definition
388
405
  */
389
- interface Media {
406
+ interface Media extends Item {
390
407
  id: string;
391
408
  name: string;
392
409
  type: string;
@@ -499,4 +516,4 @@ interface Definition {
499
516
  }
500
517
 
501
518
  export { ComponentsManager, DefinitionsManager, EventsManager, FieldsManager, FontsParser, FormsManager, MediasParser, Tracking };
502
- export type { Action, ActionDefinition, ActionValue, Breadcrumb, Button, ButtonSize, ButtonTheme, ButtonType, ControlSize, Definition, DropdownAlign, Feedback, Field, FieldOption, Filter, Font, Form, FormError, FormStatus, Item, Label, Media, MenuItem, Message, Modal, Page, PanneauComponents, PanneauDefinition, PanneauIntl, PanneauIntlValues, PanneauTheme, Preview, Resource, ResourceIntl, ResourceIntlValues, Routes, SelectOption, StatusCode, TableColumn, Toggle, TrackingVariables, TriggerUpdate, Uppy, User, uppy };
519
+ export type { Action, ActionDefinition, ActionValue, Breadcrumb, Button, ButtonSize, ButtonTheme, ButtonType, ControlSize, Definition, DropdownAlign, Feedback, Field, FieldOption, Filter, Font, Form, FormError, FormStatus, Item, Label, Media, MenuItem, Message, Modal, Page, Pagination, PanneauComponents, PanneauDefinition, PanneauIntl, PanneauIntlValues, PanneauTheme, Preview, Resource, ResourceIndex, ResourceIntl, ResourceIntlValues, ResourceItem, Routes, SelectOption, StatusCode, TableColumn, Toggle, TrackingVariables, TriggerUpdate, Uppy, User, uppy };