<commit_before>import * as React from "react";
import * as rx from "rxjs";
import * as op from "rxjs/operators";
import { setTimeout } from "timers";
import { list, useLock } from "../utils";
import { DateQuery, DateType } from "../../_gql/globalTypes";
import { DocumentNode } from "graphql";

interface ListItemData {
  id: string;
  date: string;
}

interface ListItem<T extends ListItemData> {
  data: T;
  el: JSX.Element;
}

interface ItemScrollData<T extends ListItemData> {
  item: ListItem<T>;
  y: number;
  el: HTMLElement;
}

export interface ScrollProps<T extends ListItemData, QueryResult, QueryVariables, SubscriptionResult, SubscriptionVariables> {
  items: T[];
  onChangeItems: (items: T[]) => void;
  newItemOrder: "top" | "bottom";
  query: DocumentNode;
  queryVariables: (dateQuery: DateQuery) => QueryVariables;
  queryResultConverter: (result: QueryResult) => T[];
  subscription: DocumentNode;
  subscriptionVariables: SubscriptionVariables;
  subscriptionResultConverter: (result: SubscriptionResult) => T;
  width: number;
  debounceTime: number;
  autoScrollSpeed: number;
  isAutoScroll: boolean;
  // スクロール位置変更イベント
  scrollNewItemChange: (item: T) => void;
  // スクロール位置変更命令
  scrollNewItem: rx.Observable<string | null>;
  dataToEl: (data: T) => JSX.Element;
  style?: React.CSSProperties;
  className?: string;
}

function elHeight(el: HTMLElement) {
  return el.offsetHeight;
}

function elTop(el: HTMLElement) {<commit_msg>プロパティ変更<commit_after>import * as React from "react";
import * as rx from "rxjs";
import * as op from "rxjs/operators";
import { setTimeout } from "timers";
import { list, useLock } from "../utils";
import { DateQuery, DateType } from "../../_gql/globalTypes";
import { DocumentNode } from "graphql";

interface ListItemData {
  id: string;
  date: string;
}

interface ListItem<T extends ListItemData> {
  data: T;
  el: JSX.Element;
}

interface ItemScrollData<T extends ListItemData> {
  item: ListItem<T>;
  y: number;
  el: HTMLElement;
}

export interface ScrollProps<T extends ListItemData, QueryResult, QueryVariables, SubscriptionResult, SubscriptionVariables> {
  items: T[];
  onChangeItems: (items: T[]) => void;
  newItemOrder: "top" | "bottom";
  query: DocumentNode;
  queryVariables: (dateQuery: DateQuery) => QueryVariables;
  queryResultConverter: (result: QueryResult) => T[];
  subscription: DocumentNode;
  subscriptionVariables: SubscriptionVariables;
  subscriptionResultConverter: (result: SubscriptionResult) => T;
  width: number;
  debounceTime: number;
  autoScrollSpeed: number;
  isAutoScroll: boolean;
  // スクロール位置変更イベント
  scrollNewItemChange: (item: T) => void;
  // スクロール位置変更命令
  scrollNewItem: rx.Observable<string>;
  dataToEl: (data: T) => JSX.Element;
  style?: React.CSSProperties;
  className?: string;
}

function elHeight(el: HTMLElement) {
  return el.offsetHeight;
}

function elTop(el: HTMLElement) {
{'fraction_non_alphanumeric': 0.12590548464987927, 'fraction_numerical': 0.0, 'mean_word_length': 5.079664570230608, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, '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': '4408420', 'n_tokens_mistral': 951, 'n_tokens_neox': 970, 'n_words': 251}