import Runtime from "./runtime"; import { Integration } from "./integrations/use"; import SubController from "./sub"; import State from "./state"; import Storage, { StorageConfigInterface } from "./storage"; import Collection, { DefaultDataItem } from "./collection"; import Computed from "./computed"; import API, { apiConfig } from "./api"; import Event, { EventConfig, DefaultEventPayload } from "./event"; export interface AgileConfigInterface { framework?: Integration | any; logJobs?: boolean; waitForMount?: boolean; storageConfig?: StorageConfigInterface; } export default class Agile { config: AgileConfigInterface; runtime: Runtime; integration: Integration | null; subController: SubController; storage: Storage; constructor(config?: AgileConfigInterface); /** * Init a Framework like React or a custom one */ initFrameworkIntegration(frameworkConstructor: any): void; /** * Create Agile API * @param config Object * @param config.options Object - Typescript default: RequestInit (headers, credentials, mode, etc...) * @param config.baseURL String - Url to prepend to endpoints (without trailing slash) * @param config.timeout Number - Time to wait for request before throwing error */ API: (config: apiConfig) => API; /** * Create Agile Storage */ Storage: (config: StorageConfigInterface) => Storage; /** * Create Agile State * @param initialState Any - the value to initialize a State instance with * @key State key/name which identifies the state */ State: (initialState: ValueType, key?: string | undefined) => State; /** * Create Agile Collection */ Collection: (config?: import("./collection").CollectionConfigInterface | ((collection: Collection) => import("./collection").CollectionConfigInterface) | undefined) => Collection; /** * Create a Agile computed function * @param deps Array - An array of state items to depend on * @param computeFunction Function - A function where the return value is the state, ran every time a dep changes */ Computed: (computeFunction: () => ComputedValueType, deps?: State[] | undefined) => Computed; /** * Create a Pulse Event */ Event: (config?: EventConfig | undefined) => Event; /** * Configures the Agile Storage * @param storageConfig */ setStorage(storageConfig: StorageConfigInterface): void; /** * @internal * Creates a global reference to the first pulse instance created this runtime */ private globalBind; }