diff --git a/types/frida-gum/frida-gum-tests.ts b/types/frida-gum/frida-gum-tests.ts index fda416b0500e45..84b058a7c3bb0f 100644 --- a/types/frida-gum/frida-gum-tests.ts +++ b/types/frida-gum/frida-gum-tests.ts @@ -393,6 +393,17 @@ const moduleObserver = Process.attachModuleObserver({ }); moduleObserver.detach(); +const db = SqliteDatabase.openInline("AAAA"); +const stmt = db.prepare("SELECT * from tab;"); +// $ExpectType string[] +stmt.columnNames; +// $ExpectType SqliteColumnType[] +stmt.columnTypes; +// $ExpectType (string | null)[] +stmt.declaredTypes; +// $ExpectType number +stmt.paramsCount; + // $ExpectType Profiler const profiler = new Profiler(); const sampler = new BusyCycleSampler(); diff --git a/types/frida-gum/index.d.ts b/types/frida-gum/index.d.ts index 3d036f8b2c7b73..fc989bf079b842 100644 --- a/types/frida-gum/index.d.ts +++ b/types/frida-gum/index.d.ts @@ -3118,6 +3118,28 @@ type SqliteOpenFlag = * Pre-compiled SQL statement. */ declare class SqliteStatement { + /** + * Names of the columns in the prepared statement. + */ + readonly columnNames: string[]; + + /** + * Types of the columns in the prepared statement. + */ + readonly columnTypes: SqliteColumnType[]; + + /** + * Declared types of the columns as specified in the table schema. Each + * element is the type string (e.g. `"TEXT"`, `"INTEGER"`) or `null` if + * the column has no declared type (e.g. expression columns). + */ + readonly declaredTypes: Array; + + /** + * Number of SQL parameters in the prepared statement. + */ + readonly paramsCount: number; + /** * Binds the integer `value` to `index`. * @@ -3172,6 +3194,8 @@ declare class SqliteStatement { reset(): void; } +type SqliteColumnType = "integer" | "float" | "text" | "blob" | "null"; + /** * Intercepts execution through inline hooking. */