mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Iterate PR
This commit is contained in:
parent
6fd1dc7d18
commit
e0ac200e27
3 changed files with 9 additions and 9 deletions
|
@ -25,7 +25,7 @@ export class DecryptionFailure {
|
|||
}
|
||||
}
|
||||
|
||||
type Fn = (count: number, trackedErrCode: string) => void;
|
||||
type TrackingFn = (count: number, trackedErrCode: string) => void;
|
||||
type ErrCodeMapFn = (errcode: string) => string;
|
||||
|
||||
export class DecryptionFailureTracker {
|
||||
|
@ -73,7 +73,7 @@ export class DecryptionFailureTracker {
|
|||
* @param {function?} errorCodeMapFn The function used to map error codes to the
|
||||
* trackedErrorCode. If not provided, the `.code` of errors will be used.
|
||||
*/
|
||||
constructor(private readonly fn: Fn, private readonly errorCodeMapFn?: ErrCodeMapFn) {
|
||||
constructor(private readonly fn: TrackingFn, private readonly errorCodeMapFn?: ErrCodeMapFn) {
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
throw new Error('DecryptionFailureTracker requires tracking function');
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts
|
|||
* @param {object} [options] Options for linkifyString. Default: linkifyMatrix.options
|
||||
* @returns {string} Linkified string
|
||||
*/
|
||||
export function linkifyString(str: string, options = linkifyMatrix.options) {
|
||||
export function linkifyString(str: string, options = linkifyMatrix.options): string {
|
||||
return _linkifyString(str, options);
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ export function linkifyString(str: string, options = linkifyMatrix.options) {
|
|||
* @param {object} [options] Options for linkifyElement. Default: linkifyMatrix.options
|
||||
* @returns {object}
|
||||
*/
|
||||
export function linkifyElement(element: HTMLElement, options = linkifyMatrix.options) {
|
||||
export function linkifyElement(element: HTMLElement, options = linkifyMatrix.options): HTMLElement {
|
||||
return _linkifyElement(element, options);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,24 +30,24 @@ export default class EditorStateTransfer {
|
|||
|
||||
constructor(private readonly event: MatrixEvent) {}
|
||||
|
||||
setEditorState(caret: Caret, serializedParts: SerializedPart[]) {
|
||||
public setEditorState(caret: Caret, serializedParts: SerializedPart[]) {
|
||||
this.caret = caret;
|
||||
this.serializedParts = serializedParts;
|
||||
}
|
||||
|
||||
hasEditorState() {
|
||||
public hasEditorState() {
|
||||
return !!this.serializedParts;
|
||||
}
|
||||
|
||||
getSerializedParts() {
|
||||
public getSerializedParts() {
|
||||
return this.serializedParts;
|
||||
}
|
||||
|
||||
getCaret() {
|
||||
public getCaret() {
|
||||
return this.caret;
|
||||
}
|
||||
|
||||
getEvent() {
|
||||
public getEvent() {
|
||||
return this.event;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue