import Taro from './index' type TaroGetDerivedStateFromProps
= /** * Returns an update to a component's state based on its new props and old state. * * Note: its presence prevents any of the deprecated lifecycle methods from being invoked */ (nextProps: Readonly
, prevState: S) => Partial | null;
interface TaroStaticLifecycle
{ getDerivedStateFromProps?: TaroGetDerivedStateFromProps
; } interface TaroNewLifecycle
{ /** * Runs before React applies the result of `render` to the document, and * returns an object to be given to componentDidUpdate. Useful for saving * things such as scroll position before `render` causes changes to it. * * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated * lifecycle events from running. */ getSnapshotBeforeUpdate?(prevProps: Readonly
, prevState: Readonly): SS | null;
/**
* Called immediately after updating occurs. Not called for the initial render.
*
* The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
*/
componentDidUpdate?(prevProps: Readonly
, prevState: Readonly = TaroGetDerivedStateFromProps
type StaticLifecycle = TaroStaticLifecycle
type NewLifecycle = TaroNewLifecycle
interface TaroStatic {
PageNotFoundObject: PageNotFoundObject
PageScrollObject: PageScrollObject
ShareAppMessageObject: ShareAppMessageObject
ShareAppMessageReturn: ShareAppMessageReturn
TabItemTapObject: TabItemTapObject
AddToFavoritesObject: AddToFavoritesObject
AddToFavoritesReturnObject: AddToFavoritesReturnObject
ShareTimelineReturnObject: ShareTimelineReturnObject
}
}
, snapshot?: SS): void;
}
declare module './index' {
interface PageNotFoundObject {
/**
* 不存在页面的路径
*/
path: string
/**
* 打开不存在页面的 query
*/
query: Record