Update typing modules

This commit is contained in:
2026-03-25 20:14:26 +01:00
parent 331b0ef114
commit 3ad16d8f32
10 changed files with 414 additions and 464 deletions
+4 -2
View File
@@ -12,6 +12,8 @@ if (document.body.getAttribute('data-debug') !== 'true' || localStorage.producti
enableProdMode();
}
if (typeof module !== 'undefined' && module.hot) {
module.hot.accept();
if (typeof module !== 'undefined' && (module as any).hot) {
(module as any).hot.accept();
}
@@ -29,6 +29,7 @@ import { emptyTag, getAvailableTags } from '../../../common/tags';
import { ButtMarkEditorState } from '../../shared/butt-mark-editor/butt-mark-editor';
import { parseColorWithAlpha } from '../../../common/color';
import { loadAndInitSpriteSheets } from '../../../client/loadSprites';
import { saveAs } from 'file-saver';
const frontHoofTitles = ['', 'Fetlocks', 'Paws', 'Claws', ''];
const backHoofTitles = ['', 'Fetlocks', 'Paws', '', ''];
@@ -16,6 +16,7 @@ import { createEyeSprite } from '../../../common/spriteUtils';
import { times, hasFlag } from '../../../common/utils';
import { PonyTownGame } from '../../../client/game';
import { getEntityNames } from '../../services/model';
import { saveAs } from 'file-saver';
function eyeSprite(e: PonyEye | undefined) {
return createEyeSprite(e, 0, sprites.defaultPalette);
@@ -10,6 +10,7 @@ import { cloneDeep } from '../../../common/utils';
import { PonyTownGame } from '../../../client/game';
import { updateRangeIndicator, readFileAsText } from '../../../client/clientUtils';
import { faSlidersH, faCommentSlash, faGamepad, faImage, faDownload, faUpload, faComment } from '../../../client/icons';
import { saveAs } from 'file-saver';
@Component({
selector: 'settings-modal',
+1 -1
View File
@@ -24,7 +24,7 @@ export default function (server: ServerConfig, settings: Settings, world: World
handleJSON(server, req, res, createGetAccountCharacters(findAllCharacters)(req.user as IAccount));
});
app.get('/animation/:id', offline, (req, res) => {
app.get<{ id: string }>('/animation/:id', offline, (req, res) => {
const filePath = path.join(paths.store, req.params.id);
res.sendFile(filePath);
+7 -2
View File
@@ -288,9 +288,14 @@ export function authRoutes(
});
});
app.post('/sign-out', wrap(server, req => {
app.post('/sign-out', wrap(server, async req => {
kickCurrentUser(req);
req.logout();
await new Promise<void>(resolve => req.logout(error => {
if (error) {
logger.error(error);
}
resolve();
}));
return { success: true };
}));
+2 -2
View File
@@ -162,8 +162,8 @@ app.use(bodyParser.urlencoded({ extended: true, limit }));
app.use(require('cookie-parser')());
if (args.login || args.admin) {
passport.serializeUser<IAccount, string>((account, done) => done(null, account._id.toString()));
passport.deserializeUser<IAccount | false, string>((id, done) =>
passport.serializeUser<string>((account, done) => done(null, (account as IAccount)._id.toString()));
passport.deserializeUser<string>((id, done) =>
Account.findById(id, (err, a) => done(err, a && !isBanned(a) ? a : false)));
}
+1 -1
View File
@@ -81,7 +81,7 @@ export function execAsync(command: string, options?: ExecOptions) {
if (error) {
reject(error);
} else {
resolve({ stdout, stderr });
resolve({ stdout: stdout.toString(), stderr: stderr.toString() });
}
});
});