Moved to ts (#6593)

* Moved to ts

* Fixed type check

* Removed js suffixes

* Migrated to ts

* Fixed ts.

* Fixed type check

* Installed missing d ts
This commit is contained in:
SamTV12345 2024-08-17 20:14:36 +02:00 committed by GitHub
parent 5ee2c4e7f8
commit 7e3ad03e2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 961 additions and 830 deletions

View file

@ -19,7 +19,8 @@
* limitations under the License.
*/
const AttributeMap = require('../../static/js/AttributeMap');
import AttributeMap from '../../static/js/AttributeMap';
import AttributePool from "../../static/js/AttributePool";
const Changeset = require('../../static/js/Changeset');
const { checkValidRev } = require('./checkValidRev');
@ -51,7 +52,7 @@ type LineModel = {
[id:string]:string|number|LineModel
}
exports._analyzeLine = (text:string, aline: LineModel, apool: Function) => {
exports._analyzeLine = (text:string, aline: LineModel, apool: AttributePool) => {
const line: LineModel = {};
// identify list

View file

@ -27,7 +27,7 @@ const hooks = require('../../static/js/pluginfw/hooks');
const eejs = require('../eejs');
const _analyzeLine = require('./ExportHelper')._analyzeLine;
const _encodeWhitespace = require('./ExportHelper')._encodeWhitespace;
const padutils = require('../../static/js/pad_utils').padutils;
import padutils from "../../static/js/pad_utils";
const getPadHTML = async (pad: PadType, revNum: string) => {
let atext = pad.atext;

View file

@ -18,7 +18,7 @@ import {APool} from "../types/PadType";
* limitations under the License.
*/
const AttributePool = require('../../static/js/AttributePool');
import AttributePool from '../../static/js/AttributePool';
const {Pad} = require('../db/Pad');
const Stream = require('./Stream');
const authorManager = require('../db/AuthorManager');
@ -61,7 +61,7 @@ exports.setPadRaw = async (padId: string, r: string, authorId = '') => {
try {
const processRecord = async (key:string, value: null|{
padIDs: string|Record<string, unknown>,
pool: APool
pool: AttributePool
}) => {
if (!value) return;
const keyParts = key.split(':');

View file

@ -3,7 +3,7 @@
import {PadAuthor, PadType} from "../types/PadType";
import {MapArrayType} from "../types/MapType";
const AttributeMap = require('../../static/js/AttributeMap');
import AttributeMap from '../../static/js/AttributeMap';
const Changeset = require('../../static/js/Changeset');
const attributes = require('../../static/js/attributes');
const exportHtml = require('./ExportHtml');