Improve more typing
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
1fc5138cfe
commit
3cb7a6ab78
4 changed files with 5 additions and 5 deletions
|
@ -18,14 +18,14 @@ const emailRegex = /^\S+@\S+\.\S+$/;
|
||||||
const mxUserIdRegex = /^@\S+:\S+$/;
|
const mxUserIdRegex = /^@\S+:\S+$/;
|
||||||
const mxRoomIdRegex = /^!\S+:\S+$/;
|
const mxRoomIdRegex = /^!\S+:\S+$/;
|
||||||
|
|
||||||
export const addressTypes = ['mx-user-id', 'mx-room-id', 'email'];
|
|
||||||
|
|
||||||
export enum AddressType {
|
export enum AddressType {
|
||||||
Email = "email",
|
Email = "email",
|
||||||
MatrixUserId = "mx-user-id",
|
MatrixUserId = "mx-user-id",
|
||||||
MatrixRoomId = "mx-room-id",
|
MatrixRoomId = "mx-room-id",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const addressTypes = [AddressType.Email, AddressType.MatrixRoomId, AddressType.MatrixUserId];
|
||||||
|
|
||||||
// PropType definition for an object describing
|
// PropType definition for an object describing
|
||||||
// an address that can be invited to a room (which
|
// an address that can be invited to a room (which
|
||||||
// could be a third party identifier or a matrix ID)
|
// could be a third party identifier or a matrix ID)
|
||||||
|
|
|
@ -93,7 +93,7 @@ export default class AddressPickerDialog extends React.Component<IProps, IState>
|
||||||
private queryChangedDebouncer: NodeJS.Timeout;
|
private queryChangedDebouncer: NodeJS.Timeout;
|
||||||
private cancelThreepidLookup: () => void;
|
private cancelThreepidLookup: () => void;
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps: Partial<IProps> = {
|
||||||
value: "",
|
value: "",
|
||||||
focus: true,
|
focus: true,
|
||||||
validAddressTypes: addressTypes,
|
validAddressTypes: addressTypes,
|
||||||
|
|
|
@ -38,7 +38,7 @@ interface IState {
|
||||||
|
|
||||||
@replaceableComponent("views.elements.ActionButton")
|
@replaceableComponent("views.elements.ActionButton")
|
||||||
export default class ActionButton extends React.Component<IProps, IState> {
|
export default class ActionButton extends React.Component<IProps, IState> {
|
||||||
static defaultProps = {
|
static defaultProps: Partial<IProps> = {
|
||||||
size: "25",
|
size: "25",
|
||||||
tooltip: false,
|
tooltip: false,
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@ interface IProps {
|
||||||
|
|
||||||
@replaceableComponent("views.elements.AddressTile")
|
@replaceableComponent("views.elements.AddressTile")
|
||||||
export default class AddressTile extends React.Component<IProps> {
|
export default class AddressTile extends React.Component<IProps> {
|
||||||
static defaultProps = {
|
static defaultProps: Partial<IProps> = {
|
||||||
canDismiss: false,
|
canDismiss: false,
|
||||||
onDismissed: function() {}, // NOP
|
onDismissed: function() {}, // NOP
|
||||||
justified: false,
|
justified: false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue