<commit_before>import qs from 'querystring';
import type {LinkUnfurls} from '@slack/web-api';
import axios from 'axios';
// @ts-ignore
import logger from '../lib/logger.js';
import type {SlackInterface} from '../lib/slack';

const getScrapboxUrl = (pageName: string) => `https://scrapbox.io/api/pages/tsg/${pageName}`;

interface Link {
	url: string;
	domain: string; // e.g. scrapbox.io
}

interface ScrapboxUser {
	id: string;
	name: string;
	displayName: string;
	photo: string; // URL
}

interface ScrapboxLine {
	id: string;
	text: string;
	userId: string;
	created: number;
	updated: number;
}

interface ScrapboxPage {
	id: string;
	title: string;
	image: string; // URL
	descriptions: string[];
	user: ScrapboxUser;
	pin: number;
	views: number;
	linked: number;
	commitId: string;
	created: number;
	updated: number;
	accessed: number;
	snapshotCreated: number;
	persistent: boolean;
	lines: ScrapboxLine[];<commit_msg>Use hakatashi-style interface<commit_after>import qs from 'querystring';
import type {LinkUnfurls} from '@slack/web-api';
import axios from 'axios';
// @ts-ignore
import logger from '../lib/logger.js';
import type {SlackInterface} from '../lib/slack';

const getScrapboxUrl = (pageName: string) => `https://scrapbox.io/api/pages/tsg/${pageName}`;

interface Link {
	url: string,
	domain: string, // e.g. scrapbox.io
}

interface ScrapboxUser {
	id: string,
	name: string,
	displayName: string,
	photo: string, // URL
}

interface ScrapboxLine {
	id: string,
	text: string,
	userId: string,
	created: number,
	updated: number,
}

interface ScrapboxPage {
	id: string,
	title: string,
	image: string, // URL
	descriptions: string[],
	user: ScrapboxUser,
	pin: number,
	views: number,
	linked: number,
	commitId: string,
	created: number,
	updated: number,
	accessed: number,
	snapshotCreated: number,
	persistent: boolean,
	lines: ScrapboxLine[],
{'fraction_non_alphanumeric': 0.13942307692307693, 'fraction_numerical': 0.0, 'mean_word_length': 4.607784431137724, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '462464', 'n_tokens_mistral': 664, 'n_tokens_neox': 672, 'n_words': 185}