зеркало из https://github.com/nextcloud/text.git
chore: Add typescript support
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Родитель
e7450a0826
Коммит
f3adcfffd8
|
@ -2,5 +2,9 @@ module.exports = {
|
|||
root: true,
|
||||
extends: [
|
||||
'@nextcloud',
|
||||
'@nextcloud/eslint-config/typescript',
|
||||
],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': ['off'],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
"build": "vite --mode production build",
|
||||
"dev": "vite --mode development build",
|
||||
"watch": "vite --mode development build --watch",
|
||||
"lint": "eslint --ext .js,.vue src cypress",
|
||||
"lint:fix": "eslint --ext .js,.vue src cypress --fix",
|
||||
"lint": "tsc && eslint --ext .js,.vue src cypress",
|
||||
"lint:fix": "tsc && eslint --ext .js,.vue src cypress --fix",
|
||||
"stylelint": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss",
|
||||
"stylelint:fix": "stylelint src/**/*.vue src/**/*.scss src/**/*.css css/*.scss --fix",
|
||||
"test": "NODE_ENV=test jest",
|
||||
|
|
|
@ -34,7 +34,7 @@ import { toBase64, fromBase64 } from 'lib0/buffer'
|
|||
*
|
||||
* @param {ArrayBuffer} data - binary data to encode
|
||||
*/
|
||||
export function encodeArrayBuffer(data) {
|
||||
export function encodeArrayBuffer(data: ArrayBuffer): string {
|
||||
const view = new Uint8Array(data)
|
||||
return toBase64(view)
|
||||
}
|
||||
|
@ -43,6 +43,6 @@ export function encodeArrayBuffer(data) {
|
|||
*
|
||||
* @param {string} encoded - base64 encoded string to decode
|
||||
*/
|
||||
export function decodeArrayBuffer(encoded) {
|
||||
export function decodeArrayBuffer(encoded: string): ArrayBuffer {
|
||||
return fromBase64(encoded)
|
||||
}
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
import { encodeArrayBuffer, decodeArrayBuffer } from '../helpers/base64.js'
|
||||
import { encodeArrayBuffer, decodeArrayBuffer } from '../helpers/base64.ts'
|
||||
import * as Y from 'yjs'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
import { logger } from '../helpers/logger.js'
|
||||
import { encodeArrayBuffer, decodeArrayBuffer } from '../helpers/base64.js'
|
||||
import { encodeArrayBuffer, decodeArrayBuffer } from '../helpers/base64.ts'
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import recorded from './fixtures/recorded'
|
||||
import { Doc, encodeStateAsUpdate } from 'yjs'
|
||||
import { decodeArrayBuffer } from '../helpers/base64.js'
|
||||
import { decodeArrayBuffer } from '../helpers/base64.ts'
|
||||
import * as decoding from 'lib0/decoding'
|
||||
import * as encoding from 'lib0/encoding'
|
||||
import * as syncProtocol from 'y-protocols/sync'
|
||||
|
|
Загрузка…
Ссылка в новой задаче