mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Update typing modules
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 };
|
||||
}));
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
@@ -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() });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user