Fix: Resolve implicit any and property access errors in core components

This commit is contained in:
Scott Idem
2026-01-22 19:44:10 -05:00
parent 94a387ca6d
commit 32002fe6bd
4 changed files with 16 additions and 14 deletions

View File

@@ -74,11 +74,11 @@
reencode: null,
video_file: null
};
let download_clip_src: string = $state();
let download_clip_filename: string;
let download_clip_src: string = $state('');
let download_clip_filename: string = $state('clipped_video.mp4');
// *** Functions and Logic
async function handle_submit_form_files(event: SubmitEvent) {
async function handle_submit_form_files(event: Event) {
console.log('*** handle_submit_form() ***');
$ae_sess.files.disable_submit__hosted_file_obj = true;
@@ -169,7 +169,7 @@
upload_complete = true;
}
async function handle_input_upload_files(input_upload_files, form_kv, task_id) {
async function handle_input_upload_files(input_upload_files: File[], form_kv: any, task_id: string) {
console.log('*** handle_input_upload_files() ***');
console.log(input_upload_files);
console.log(form_kv);

View File

@@ -95,19 +95,21 @@
let hosted_file_results;
const target = event.target as HTMLFormElement;
const file_input = target ? (target[input_element_id] as HTMLInputElement) : null;
if (
target &&
target[input_element_id] &&
(target[input_element_id] as HTMLInputElement)?.files &&
(target[input_element_id] as HTMLInputElement).files.length > 0
file_input &&
file_input.files &&
file_input.files.length > 0
) {
task_id = link_to_id; // Ideally this should be the file hash, but we may be uploading multiple files at once. This should be done with a loop instead?
// Loop through each file and upload them individually in event.target[input_element_id].files
// The task_id should be the file hash.
// processed_file_list[i] has the file hash_sha256, hash_sha256_match, warnings, uploaded, uploaded_bytes, filename, and file_size_bytes.
for (let i = 0; i < event.target[input_element_id].files.length; i++) {
let tmp_file = event.target[input_element_id].files[i];
for (let i = 0; i < file_input.files.length; i++) {
let tmp_file = file_input.files[i];
task_id = $ae_sess.files.processed_file_list[i].hash_sha256;
@@ -126,7 +128,7 @@
// hosted_file_results = await handle_input_upload_files(event.target[input_element_id].files, task_id);
$ae_sess.files.processed_file_list = [];
$ae_sess = $ae_sess; // Is this needed? 2025-03-17
event.target.reset();
target.reset();
// await tick();
if (log_lvl) {

View File

@@ -213,7 +213,7 @@
return true;
})
.catch((err) => {
.catch((err: any) => {
console.log('There was an error while trying to start the QR scanner');
scanning_status = 'start_error';
@@ -320,7 +320,7 @@
qr_entered_text = null;
}
function send_init_confirm_email(subject, message) {
function send_init_confirm_email(subject: string, message: any) {
console.log(`*** send_init_confirm_email() *** ${subject}`);
let to_email = 'scott.idem+skdev@oneskyit.com';

View File

@@ -258,14 +258,14 @@
return processed_file_list;
}
function remove_file_from_filelist(index) {
function remove_file_from_filelist(index: number) {
console.log('*** remove_file_from_filelist() ***');
// Can not use something like this because it is readonly:
const dt = new DataTransfer();
// let input = document.getElementById(input_element_id);
let input_element = document.querySelector('input[type="file"].svelte_input_file_element');
let input_element = document.querySelector('input[type="file"].svelte_input_file_element') as HTMLInputElement;
if (!input_element) {
console.error('Could not find the input element.');