@types/react-mentions
Advanced tools
Comparing version 4.1.8 to 4.1.9
@@ -24,3 +24,5 @@ // Type definitions for react-mentions 4.1 | ||
*/ | ||
export interface MentionsInputProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'onBlur' | 'onKeyDown' | 'onSelect'> { | ||
export interface MentionsInputProps | ||
extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "onBlur" | "onKeyDown" | "onSelect"> | ||
{ | ||
/** | ||
@@ -41,5 +43,12 @@ * If set to `true` a regular text input element will be rendered | ||
placeholder?: string | undefined; | ||
onBlur?: ((event: React.FocusEvent<HTMLInputElement> | React.FocusEvent<HTMLTextAreaElement>, clickedSuggestion: boolean) => void) | undefined; | ||
onBlur?: | ||
| (( | ||
event: React.FocusEvent<HTMLInputElement> | React.FocusEvent<HTMLTextAreaElement>, | ||
clickedSuggestion: boolean, | ||
) => void) | ||
| undefined; | ||
onSelect?: ((event: React.UIEvent) => void) | undefined; | ||
onKeyDown?: ((event: React.KeyboardEvent<HTMLTextAreaElement> | React.KeyboardEvent<HTMLInputElement>) => void) | undefined; | ||
onKeyDown?: | ||
| ((event: React.KeyboardEvent<HTMLTextAreaElement> | React.KeyboardEvent<HTMLInputElement>) => void) | ||
| undefined; | ||
children: React.ReactElement<MentionProps> | Array<React.ReactElement<MentionProps>>; | ||
@@ -88,3 +97,11 @@ className?: string | undefined; | ||
onAdd?: ((id: string | number, display: string) => void) | undefined; | ||
renderSuggestion?: ((suggestion: SuggestionDataItem, search: string, highlightedDisplay: React.ReactNode, index: number, focused: boolean) => React.ReactNode) | undefined; | ||
renderSuggestion?: | ||
| (( | ||
suggestion: SuggestionDataItem, | ||
search: string, | ||
highlightedDisplay: React.ReactNode, | ||
index: number, | ||
focused: boolean, | ||
) => React.ReactNode) | ||
| undefined; | ||
className?: string | undefined; | ||
@@ -128,3 +145,8 @@ markup?: string | undefined; | ||
*/ | ||
export type OnChangeHandlerFunc = (event: { target: { value: string } }, newValue: string, newPlainTextValue: string, mentions: MentionItem[]) => void; | ||
export type OnChangeHandlerFunc = ( | ||
event: { target: { value: string } }, | ||
newValue: string, | ||
newPlainTextValue: string, | ||
mentions: MentionItem[], | ||
) => void; | ||
@@ -134,2 +156,5 @@ /** | ||
*/ | ||
export type DataFunc = (query: string, callback: (data: SuggestionDataItem[]) => void) => Promise<void> | void | Promise<SuggestionDataItem[]> | SuggestionDataItem[]; | ||
export type DataFunc = ( | ||
query: string, | ||
callback: (data: SuggestionDataItem[]) => void, | ||
) => Promise<void> | void | Promise<SuggestionDataItem[]> | SuggestionDataItem[]; |
@@ -7,5 +7,5 @@ /** | ||
import { MentionProps } from '../../index'; | ||
import { MentionProps } from "../../index"; | ||
export type Config = Pick<MentionProps, 'markup' | 'regex' | 'displayTransform'>; | ||
export type Config = Pick<MentionProps, "markup" | "regex" | "displayTransform">; | ||
@@ -12,0 +12,0 @@ export interface Options { |
@@ -1,2 +0,2 @@ | ||
import * as React from 'react'; | ||
import * as React from "react"; | ||
@@ -3,0 +3,0 @@ export function createDefaultStyle( |
@@ -1,1 +0,1 @@ | ||
export function findPositionOfCapturingGroup(markup: string, parameterName: 'id' | 'display'): 0 | 1; | ||
export function findPositionOfCapturingGroup(markup: string, parameterName: "id" | "display"): 0 | 1; |
@@ -7,3 +7,3 @@ /** | ||
import { Config } from './applyChangeToValue'; | ||
import { Config } from "./applyChangeToValue"; | ||
@@ -10,0 +10,0 @@ export function findStartOfMentionInPlainText( |
@@ -1,3 +0,3 @@ | ||
import { Config } from './applyChangeToValue'; | ||
import { Config } from "./applyChangeToValue"; | ||
export function getEndOfLastMention(value: string, config: Partial<Config>): number; |
@@ -1,2 +0,2 @@ | ||
import { Config } from './applyChangeToValue'; | ||
import { Config } from "./applyChangeToValue"; | ||
@@ -3,0 +3,0 @@ export interface Mention { |
@@ -1,3 +0,3 @@ | ||
import { Config } from './applyChangeToValue'; | ||
import { Config } from "./applyChangeToValue"; | ||
export function getPlainText(value: string, config: Partial<Config>): string; |
@@ -1,27 +0,27 @@ | ||
export * from './applyChangeToValue'; | ||
export * from './combineRegExps'; | ||
export * from './countPlaceholders'; | ||
export * from './countSuggestions'; | ||
export * from './defaultStyle'; | ||
export * from './diacritics'; | ||
export * from './escapeRegex'; | ||
export * from './findPositionOfCapturingGroup'; | ||
export * from './findStartOfMentionInPlainText'; | ||
export * from './getEndOfLastMention'; | ||
export * from './getMentions'; | ||
export * from './getPlainText'; | ||
export * from './getSubstringIndex'; | ||
export * from './getSuggestionHtmlId'; | ||
export * from './isNumber'; | ||
export * from './isPlainObject'; | ||
export * from './iterateMentionsMarkup'; | ||
export * from './keys'; | ||
export * from './makeMentionsMarkup'; | ||
export * from './mapPlainTextIndex'; | ||
export * from './markupToRegex'; | ||
export * from './merge'; | ||
export * from './mergeDeep'; | ||
export * from './omit'; | ||
export * from './placeholders'; | ||
export * from './readConfigFromChildren'; | ||
export * from './spliceString'; | ||
export * from "./applyChangeToValue"; | ||
export * from "./combineRegExps"; | ||
export * from "./countPlaceholders"; | ||
export * from "./countSuggestions"; | ||
export * from "./defaultStyle"; | ||
export * from "./diacritics"; | ||
export * from "./escapeRegex"; | ||
export * from "./findPositionOfCapturingGroup"; | ||
export * from "./findStartOfMentionInPlainText"; | ||
export * from "./getEndOfLastMention"; | ||
export * from "./getMentions"; | ||
export * from "./getPlainText"; | ||
export * from "./getSubstringIndex"; | ||
export * from "./getSuggestionHtmlId"; | ||
export * from "./isNumber"; | ||
export * from "./isPlainObject"; | ||
export * from "./iterateMentionsMarkup"; | ||
export * from "./keys"; | ||
export * from "./makeMentionsMarkup"; | ||
export * from "./mapPlainTextIndex"; | ||
export * from "./markupToRegex"; | ||
export * from "./merge"; | ||
export * from "./mergeDeep"; | ||
export * from "./omit"; | ||
export * from "./placeholders"; | ||
export * from "./readConfigFromChildren"; | ||
export * from "./spliceString"; |
@@ -1,2 +0,2 @@ | ||
import { Config } from './applyChangeToValue'; | ||
import { Config } from "./applyChangeToValue"; | ||
@@ -3,0 +3,0 @@ export type MarkupIterateeFunction = ( |
@@ -15,3 +15,3 @@ /** | ||
indexInPlainText: number, | ||
inMarkupCorrection: 'START' | 'END' | 'NULL', | ||
inMarkupCorrection: "START" | "END" | "NULL", | ||
): number; |
export enum PLACEHOLDERS { | ||
id = '__id__', | ||
display = '__display__', | ||
id = "__id__", | ||
display = "__display__", | ||
} |
@@ -1,4 +0,4 @@ | ||
import { ReactNode } from 'react'; | ||
import { Config } from './applyChangeToValue'; | ||
import { ReactNode } from "react"; | ||
import { Config } from "./applyChangeToValue"; | ||
export function readConfigFromChildren(children: ReactNode): Config[]; |
{ | ||
"name": "@types/react-mentions", | ||
"version": "4.1.8", | ||
"version": "4.1.9", | ||
"description": "TypeScript definitions for react-mentions", | ||
@@ -30,4 +30,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-mentions", | ||
}, | ||
"typesPublisherContentHash": "ac38c1c76968ed6a88d8cb075e48ed96051180aaf4f7b491e2219122aaf0e498", | ||
"typeScriptVersion": "4.1" | ||
"typesPublisherContentHash": "25c8b0f8b0444c3ad12b051645b9ce0d819117c26067ec6a25dff6a65e20f3f0", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 02 Nov 2022 21:33:02 GMT | ||
* Last updated: Wed, 27 Sep 2023 07:12:04 GMT | ||
* Dependencies: [@types/react](https://npmjs.com/package/@types/react) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13718
285