helper.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132
  1. import type { MentionCtx, MentionOption } from './types';
  2. export declare const filterOption: (pattern: string, option: MentionOption) => boolean;
  3. export declare const getMentionCtx: (inputEl: HTMLInputElement | HTMLTextAreaElement, prefix: string | string[], split: string) => MentionCtx | undefined;
  4. /**
  5. * fork from textarea-caret-position
  6. * https://github.com/component/textarea-caret-position
  7. * The MIT License (MIT)
  8. * Copyright (c) 2015 Jonathan Ong me@jongleberry.com
  9. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10. * of this software and associated documentation files (the "Software"), to deal
  11. * in the Software without restriction, including without limitation the rights
  12. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. * copies of the Software, and to permit persons to whom the Software is
  14. * furnished to do so, subject to the following conditions:
  15. * The above copyright notice and this permission notice shall be included in all
  16. * copies or substantial portions of the Software.
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  23. * SOFTWARE.
  24. */
  25. export declare const getCursorPosition: (element: HTMLInputElement | HTMLTextAreaElement, options?: {
  26. debug: boolean;
  27. useSelectionEnd: boolean;
  28. }) => {
  29. top: number;
  30. left: number;
  31. height: number;
  32. };