typeset is ksh93's private (using static scoping like perl's my, not local which does dynamic scoping) only for functions that are declared using the ksh function definition style:
function foo {
typeset var=whatever
...
}
With the Bourne syntax (or with the . command (which btw, can also be used on ksh-style functions)), there's no scoping (except for $1, $2... $# of course). So one can use Bourne-style functions to get the value or change the value or type of a variable in the parent context (though typeset -n can also be used for that with the ksh-style.
In ksh88, typeset was doing dynamic scoping with both the ksh and Bourne function definition style. According to David Korn, POSIX did not specify ksh's variable scoping on the basis that it was dynamic (deemed inferior) which is why he changed it to static scoping for ksh93 (a complete rewrite).
But in the mean time, other shells have implemented variable scoping and they all did it using dynamic scoping to mimic ksh88's.
zsh now has a private keyword to have scoping similar to ksh93's in addition to local/typeset with dynamic scoping like in ksh88.
To see the difference between static and dynamic scoping, compare:
"$shell" -c 'function f { typeset a=1; g; echo "$a"; }
function g { echo "$a"; a=2; }
a=0; f'
Which with $shell == ksh93 outputs:
0
1
And with ksh88 or bash outputs:
1
2
zsh:
$ zsh -c 'zmodload zsh/param/private
f() { private a=1; g; echo $a;}
g() { echo $a; a=2; }
a=0; f'
0
1
To be able to use local scope in code portable to bash, zsh, ksh88 ksh93, pdksh, yash or dash/FreeBSD sh, you could do:
[ -n "$BASH_VERSION" ] && shopt -s expand_aliases
alias shdef= kshdef='#'
if type typeset > /dev/null 2>&1; then
alias mylocal=typeset
if (a=1; f() { typeset a=2; }; f; [ "$a" = 2 ]); then
alias shdef='#' kshdef='function'
fi
else
alias mylocal=local
fi
And then declare your functions as:
kshdef foo
shdef foo()
{
mylocal var
var=value
...
}
In any case, there are many differences between the behaviour of those local in the various shells. Beside the dynamic vs static consideration mentioned above, there's whether variables initially get an unset or empty value or inherit the value from the parent scope. And there's the interaction with readonly, unset, whether local/typeset is a keyword or builtin (affects split+glob handling)...
There are other implications of using the ksh-style function definition in ksh93, see the man page for details.
More reading