Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

more interfaces in typescript typings #153

Merged
merged 6 commits into from
May 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions typings/react-popper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,36 @@ interface ManagerProps {
}
export class Manager extends React.Component<ManagerProps, {}> { }

type RefHandler = (ref: HTMLElement | null) => void;

interface ReferenceChildrenProps {
ref: RefHandler;
}

interface ReferenceProps {
children: (props: ({
ref: (ref: HTMLElement | null) => void,
})) => React.ReactNode;
children: (props: ReferenceChildrenProps) => React.ReactNode;
}
export class Reference extends React.Component<ReferenceProps, {}> { }

interface PopperArrowProps {
ref: RefHandler;
style: React.CSSProperties;
}

interface PopperChildrenProps {
arrowProps: PopperArrowProps;
outOfBoundaries: boolean | null;
placement: PopperJS.Placement;
ref: RefHandler;
scheduleUpdate: () => void;
style: React.CSSProperties;
}

interface PopperProps {
children: (props: PopperChildrenProps) => React.ReactNode;
eventsEnabled?: boolean;
modifiers?: PopperJS.Modifiers;
placement?: PopperJS.Placement;
eventsEnabled?: boolean;
positionFixed?: boolean;
children: (props: ({
ref: (ref: HTMLElement | null) => void,
style: React.CSSProperties,
placement?: PopperJS.Placement,
outOfBoundaries: boolean | null,
scheduleUpdate: () => void,
arrowProps: {
ref: (ref: HTMLElement | null) => void,
style: React.CSSProperties,
},
})) => React.ReactNode;
}
export class Popper extends React.Component<PopperProps, {}> { }